commit 1d6b918d8d37d4ea0ec9bf97387c859beba2d269 Author: Jacob Welsh AuthorDate: Wed Nov 2 20:13:34 2022 +0000 Commit: Jacob Welsh CommitDate: Wed Nov 2 20:17:56 2022 +0000 Type: option removal configure, m4, auth, lib-dict-backend, master: remove plugin/module mode for lua, gssapi and ldap options so they're either builtin or absent Completes #4 and addresses comment #8 from http://fixpoint.welshcomputing.com/2022/classifying-the-dovecot-module-menagerie-by-load-point/ diff --git a/configure.ac b/configure.ac index bd1ef1ed4e..60023240b6 100644 --- a/configure.ac +++ b/configure.ac @@ -78,13 +78,13 @@ AS_HELP_STRING([--with-bsdauth], [Build with BSD authentication support (auto)]) want_bsdauth=auto) AC_ARG_WITH(gssapi, -AS_HELP_STRING([--with-gssapi=yes|plugin Build with GSSAPI authentication support]), - TEST_WITH(gssapi, $withval, plugin), +AS_HELP_STRING([--with-gssapi], [Build with GSSAPI authentication support]), + TEST_WITH(gssapi, $withval), want_gssapi=no) AC_ARG_WITH(ldap, -AS_HELP_STRING([--with-ldap=yes|plugin], [Build with LDAP support]), - TEST_WITH(ldap, $withval, plugin), +AS_HELP_STRING([--with-ldap], [Build with LDAP support]), + TEST_WITH(ldap, $withval), want_ldap=no) AC_ARG_WITH(libunwind, @@ -520,13 +520,10 @@ DOVECOT_WANT_CASSANDRA DOVECOT_SQL -AM_CONDITIONAL([AUTH_LUA_PLUGIN], [test "x$with_lua_plugin" = "xyes"]) AM_CONDITIONAL([HAVE_LUA], [test "x$with_lua" = "xyes"]) AS_IF([test "x$with_lua" = "xyes"], - AS_IF([test "x$with_lua_plugin" = "xyes"], - [userdb="$userdb lua (plugin)"; passdb="$passdb lua (plugin)"], - [userdb="$userdb lua"; passdb="$passdb lua"], - ), []) + [userdb="$userdb lua"; passdb="$passdb lua"], + []) AM_CONDITIONAL([DLUA_WITH_YIELDS], [test "$dlua_with_yields" = "yes"]) AC_SUBST(AUTH_CFLAGS) diff --git a/m4/want_gssapi.m4 b/m4/want_gssapi.m4 index 7866aba0de..4e97aaa093 100644 --- a/m4/want_gssapi.m4 +++ b/m4/want_gssapi.m4 @@ -35,9 +35,6 @@ AC_DEFUN([DOVECOT_WANT_GSSAPI], [ have_gssapi=yes ]) if test $have_gssapi != no; then - if test $want_gssapi = plugin; then - have_gssapi=plugin - fi AC_DEFINE(HAVE_GSSAPI,, [Build with GSSAPI support]) AC_CHECK_HEADERS(gssapi/gssapi_ext.h gssapi_krb5.h gssapi/gssapi_krb5.h) AC_CHECK_LIB(gss, __gss_userok, [ @@ -89,13 +86,9 @@ AC_DEFUN([DOVECOT_WANT_GSSAPI], [ fi LIBS=$old_LIBS - if test $want_gssapi != plugin; then - AUTH_LIBS="$AUTH_LIBS $KRB5_LIBS" - AUTH_CFLAGS="$AUTH_CFLAGS $KRB5_CFLAGS" - AC_DEFINE(BUILTIN_GSSAPI,, [GSSAPI support is built in]) - else - have_gssapi_plugin=yes - fi + AUTH_LIBS="$AUTH_LIBS $KRB5_LIBS" + AUTH_CFLAGS="$AUTH_CFLAGS $KRB5_CFLAGS" + AC_DEFINE(BUILTIN_GSSAPI,, [GSSAPI support is built in]) else if test $want_gssapi != auto; then AC_ERROR([Can't build with GSSAPI support: gssapi.h not found]) @@ -109,5 +102,4 @@ AC_DEFUN([DOVECOT_WANT_GSSAPI], [ fi fi fi - AM_CONDITIONAL(GSSAPI_PLUGIN, test "$have_gssapi_plugin" = "yes") ]) diff --git a/m4/want_ldap.m4 b/m4/want_ldap.m4 index 91d9e0f00e..0b608c2135 100644 --- a/m4/want_ldap.m4 +++ b/m4/want_ldap.m4 @@ -19,11 +19,9 @@ AC_DEFUN([DOVECOT_WANT_LDAP], [ ]) ]) AC_SUBST(LDAP_LIBS) - if test $want_ldap != plugin; then - AUTH_LIBS="$AUTH_LIBS $LDAP_LIBS" - DICT_LIBS="$DICT_LIBS $LDAP_LIBS" - AC_DEFINE(BUILTIN_LDAP,, [LDAP support is built in]) - fi + AUTH_LIBS="$AUTH_LIBS $LDAP_LIBS" + DICT_LIBS="$DICT_LIBS $LDAP_LIBS" + AC_DEFINE(BUILTIN_LDAP,, [LDAP support is built in]) AC_DEFINE(USERDB_LDAP,, [Build with LDAP support]) AC_DEFINE(PASSDB_LDAP,, [Build with LDAP support]) @@ -47,12 +45,6 @@ AC_DEFUN([DOVECOT_WANT_LDAP], [ else userdb="$userdb ldap" passdb="$passdb ldap" - if test $want_ldap = plugin; then - have_ldap_plugin=yes - userdb="$userdb (plugin)" - passdb="$passdb (plugin)" - fi fi - AM_CONDITIONAL(LDAP_PLUGIN, test "$have_ldap_plugin" = "yes") AM_CONDITIONAL(HAVE_LDAP, test "$want_ldap" != "no") ]) diff --git a/m4/want_lua.m4 b/m4/want_lua.m4 index d1cec03a30..ad8571fc24 100644 --- a/m4/want_lua.m4 +++ b/m4/want_lua.m4 @@ -1,17 +1,10 @@ AC_DEFUN([DOVECOT_WANT_LUA],[ AC_ARG_WITH([lua], - [AS_HELP_STRING([--with-lua=yes|plugin], [build Lua Bindings])], + [AS_HELP_STRING([--with-lua], [build Lua Bindings])], [with_lua=$withval], [with_lua=no] ) - AC_MSG_CHECKING([whether we will be linking in Lua]) - AS_IF([test "x$with_lua" = "xplugin"], [ - with_lua_plugin=yes - with_lua=yes - ]) - AC_MSG_RESULT([$with_lua]) - AS_IF([test "x$with_lua" != "xno"], [ AS_IF([test -n "$LUA_CFLAGS" -o -n "$LUA_LIBS"], [ with_lua=yes @@ -36,9 +29,7 @@ AC_DEFUN([DOVECOT_WANT_LUA],[ ]) AS_IF([test "x$with_lua" = "xyes"], - AS_IF([test "x$with_lua_plugin" != "xyes"], - AC_DEFINE([BUILTIN_LUA],, [Lua support is builtin]) - ) + AC_DEFINE([BUILTIN_LUA],, [Lua support is builtin]) dnl Check if various lua functions are present old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LUA_CFLAGS" diff --git a/src/auth/Makefile.am b/src/auth/Makefile.am index 9e6200b4c8..5d71848748 100644 --- a/src/auth/Makefile.am +++ b/src/auth/Makefile.am @@ -4,31 +4,15 @@ auth_moduledir = $(moduledir)/auth # automake seems to force making this unconditional.. NOPLUGIN_LDFLAGS = -if GSSAPI_PLUGIN -GSSAPI_LIB = libmech_gssapi.la -endif - -if LDAP_PLUGIN -LDAP_LIB = libauthdb_ldap.la -endif - -LUA_LIB = AUTH_LUA_LIBS = AUTH_LUA_LDADD = if HAVE_LUA -if AUTH_LUA_PLUGIN -LUA_LIB += libauthdb_lua.la -else AUTH_LUA_LIBS += $(LIBDOVECOT_LUA) AUTH_LUA_LDADD += $(LUA_LIBS) endif -endif auth_module_LTLIBRARIES = \ - $(GSSAPI_LIB) \ - $(LDAP_LIB) \ - $(LUA_LIB) \ libauthdb_imap.la pkglibexecdir = $(libexecdir)/dovecot @@ -195,27 +179,6 @@ headers = \ userdb-blocking.h \ userdb-template.h -if GSSAPI_PLUGIN -libmech_gssapi_la_LDFLAGS = -module -avoid-version -libmech_gssapi_la_LIBADD = $(KRB5_LIBS) -libmech_gssapi_la_CPPFLAGS = $(AM_CPPFLAGS) $(KRB5_CFLAGS) -DPLUGIN_BUILD -libmech_gssapi_la_SOURCES = mech-gssapi.c -endif - -if LDAP_PLUGIN -libauthdb_ldap_la_LDFLAGS = -module -avoid-version -libauthdb_ldap_la_LIBADD = $(LDAP_LIBS) -libauthdb_ldap_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_BUILD -libauthdb_ldap_la_SOURCES = $(ldap_sources) -endif - -if AUTH_LUA_PLUGIN -libauthdb_lua_la_LDFLAGS = -module -avoid-version -libauthdb_lua_la_LIBADD = $(LIBDOVECOT_LUA) -libauthdb_lua_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_BUILD -libauthdb_lua_la_SOURCES = $(lua_sources) -endif - libauthdb_imap_la_LDFLAGS = -module -avoid-version libauthdb_imap_la_LIBADD = \ ../lib-imap-client/libimap_client.la \ diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 8083108627..223567a311 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -2,7 +2,7 @@ #include "auth-common.h" -#if defined(BUILTIN_LDAP) || defined(PLUGIN_BUILD) +#ifdef BUILTIN_LDAP #include "net.h" #include "ioloop.h" @@ -2011,25 +2011,4 @@ void db_ldap_unref(struct ldap_connection **_conn) pool_unref(&conn->pool); } -#ifndef BUILTIN_LDAP -/* Building a plugin */ -extern struct passdb_module_interface passdb_ldap_plugin; -extern struct userdb_module_interface userdb_ldap_plugin; - -void authdb_ldap_init(void); -void authdb_ldap_deinit(void); - -void authdb_ldap_init(void) -{ - passdb_register_module(&passdb_ldap_plugin); - userdb_register_module(&userdb_ldap_plugin); - -} -void authdb_ldap_deinit(void) -{ - passdb_unregister_module(&passdb_ldap_plugin); - userdb_unregister_module(&userdb_ldap_plugin); -} -#endif - #endif diff --git a/src/auth/db-lua.c b/src/auth/db-lua.c index dd4e77b25f..aab5d4db71 100644 --- a/src/auth/db-lua.c +++ b/src/auth/db-lua.c @@ -1,7 +1,7 @@ /* Copyright (c) 2017-2018 Dovecot authors, see the included COPYING file */ #include "lib.h" -#if defined(BUILTIN_LUA) || defined(PLUGIN_BUILD) +#ifdef BUILTIN_LUA #include "llist.h" #include "istream.h" @@ -774,25 +774,4 @@ int auth_lua_userdb_iterate_deinit(struct userdb_iterate_context *ctx) return ret; } -#ifndef BUILTIN_LUA -/* Building a plugin */ -extern struct passdb_module_interface passdb_lua_plugin; -extern struct userdb_module_interface userdb_lua_plugin; - -void authdb_lua_init(void); -void authdb_lua_deinit(void); - -void authdb_lua_init(void) -{ - passdb_register_module(&passdb_lua_plugin); - userdb_register_module(&userdb_lua_plugin); - -} -void authdb_lua_deinit(void) -{ - passdb_unregister_module(&passdb_lua_plugin); - userdb_unregister_module(&userdb_lua_plugin); -} -#endif - #endif diff --git a/src/auth/mech-gssapi.c b/src/auth/mech-gssapi.c index e9f2af2f2b..ed7fb62055 100644 --- a/src/auth/mech-gssapi.c +++ b/src/auth/mech-gssapi.c @@ -22,7 +22,7 @@ #include "passdb.h" -#if defined(BUILTIN_GSSAPI) || defined(PLUGIN_BUILD) +#ifdef BUILTIN_GSSAPI #ifndef HAVE___GSS_USEROK # define USE_KRB5_USEROK @@ -760,31 +760,4 @@ const struct mech_module mech_gssapi_spnego = { mech_gssapi_auth_free }; -#ifndef BUILTIN_GSSAPI -void mech_gssapi_init(void); -void mech_gssapi_deinit(void); - -void mech_gssapi_init(void) -{ - mech_register_module(&mech_gssapi); -#ifdef HAVE_GSSAPI_SPNEGO - /* load if we already didn't load it using winbind */ - if (mech_module_find(mech_gssapi_spnego.mech_name) == NULL) - mech_register_module(&mech_gssapi_spnego); -#endif -} - -void mech_gssapi_deinit(void) -{ -#ifdef HAVE_GSSAPI_SPNEGO - const struct mech_module *mech; - - mech = mech_module_find(mech_gssapi_spnego.mech_name); - if (mech != NULL && mech->auth_new == mech_gssapi_auth_new) - mech_unregister_module(&mech_gssapi_spnego); -#endif - mech_unregister_module(&mech_gssapi); -} -#endif - #endif diff --git a/src/auth/passdb-ldap.c b/src/auth/passdb-ldap.c index 11b9ae891a..8dfda099aa 100644 --- a/src/auth/passdb-ldap.c +++ b/src/auth/passdb-ldap.c @@ -3,7 +3,7 @@ #include "auth-common.h" #include "passdb.h" -#if defined(PASSDB_LDAP) && (defined(BUILTIN_LDAP) || defined(PLUGIN_BUILD)) +#ifdef PASSDB_LDAP #include "ioloop.h" #include "array.h" @@ -496,11 +496,7 @@ static void passdb_ldap_deinit(struct passdb_module *_module) db_ldap_unref(&module->conn); } -#ifndef PLUGIN_BUILD struct passdb_module_interface passdb_ldap = -#else -struct passdb_module_interface passdb_ldap_plugin = -#endif { "ldap", diff --git a/src/auth/passdb-lua.c b/src/auth/passdb-lua.c index b49b98e960..75c80123a6 100644 --- a/src/auth/passdb-lua.c +++ b/src/auth/passdb-lua.c @@ -4,7 +4,7 @@ #include "passdb.h" #include "auth-cache.h" -#if defined(BUILTIN_LUA) || defined(PLUGIN_BUILD) +#ifdef BUILTIN_LUA #include "db-lua.h" @@ -170,11 +170,7 @@ static void passdb_lua_deinit(struct passdb_module *_module) dlua_script_unref(&module->script); } -#ifndef PLUGIN_BUILD struct passdb_module_interface passdb_lua = -#else -struct passdb_module_interface passdb_lua_plugin = -#endif { "lua", diff --git a/src/auth/userdb-ldap.c b/src/auth/userdb-ldap.c index ecbf09e479..652613baf3 100644 --- a/src/auth/userdb-ldap.c +++ b/src/auth/userdb-ldap.c @@ -3,7 +3,7 @@ #include "auth-common.h" #include "userdb.h" -#if defined(USERDB_LDAP) && (defined(BUILTIN_LDAP) || defined(PLUGIN_BUILD)) +#ifdef USERDB_LDAP #include "ioloop.h" #include "array.h" @@ -318,11 +318,7 @@ static void userdb_ldap_deinit(struct userdb_module *_module) db_ldap_unref(&module->conn); } -#ifndef PLUGIN_BUILD struct userdb_module_interface userdb_ldap = -#else -struct userdb_module_interface userdb_ldap_plugin = -#endif { "ldap", diff --git a/src/auth/userdb-lua.c b/src/auth/userdb-lua.c index 6b75c0d781..5c224fd3af 100644 --- a/src/auth/userdb-lua.c +++ b/src/auth/userdb-lua.c @@ -4,7 +4,7 @@ #include "userdb.h" #include "auth-cache.h" -#if defined(BUILTIN_LUA) || defined(PLUGIN_BUILD) +#ifdef BUILTIN_LUA #include "db-lua.h" @@ -114,11 +114,7 @@ static int userdb_lua_iterate_deinit(struct userdb_iterate_context *ctx) return auth_lua_userdb_iterate_deinit(ctx); } -#ifndef PLUGIN_BUILD struct userdb_module_interface userdb_lua = -#else -struct userdb_module_interface userdb_lua_plugin = -#endif { "lua", diff --git a/src/lib-dict-backend/Makefile.am b/src/lib-dict-backend/Makefile.am index 80c505012a..c57797466e 100644 --- a/src/lib-dict-backend/Makefile.am +++ b/src/lib-dict-backend/Makefile.am @@ -1,6 +1,5 @@ noinst_LTLIBRARIES = libdict_backend.la -module_dictdir = $(moduledir)/dict dict_drivers = @dict_drivers@ AM_CPPFLAGS = \ @@ -34,22 +33,10 @@ noinst_HEADERS = \ dict-sql-private.h \ dict-sql-settings.h -if LDAP_PLUGIN -LIBDICT_LDAP = libdict_ldap.la -libdict_ldap_la_DEPENDENCIES = $(LIBDOVECOT_LDAP) $(LIBDOVECOT_DEPS) -libdict_ldap_la_LDFLAGS = -module -avoid-version -libdict_ldap_la_LIBADD = $(LIBDOVECOT_LDAP) $(LIBDOVECOT) -libdict_ldap_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_BUILD -libdict_ldap_la_SOURCES = $(ldap_sources) -else if HAVE_LDAP libdict_backend_la_LIBADD += $(LIBDOVECOT_LDAP) dict_drivers += ldap endif -endif - -module_dict_LTLIBRARIES = \ - $(LIBDICT_LDAP) EXTRA_DIST = dict.conf diff --git a/src/lib-dict-backend/dict-ldap-settings.c b/src/lib-dict-backend/dict-ldap-settings.c index 01205eb047..a41b5b9428 100644 --- a/src/lib-dict-backend/dict-ldap-settings.c +++ b/src/lib-dict-backend/dict-ldap-settings.c @@ -2,7 +2,7 @@ #include "lib.h" -#if defined(BUILTIN_LDAP) || defined(PLUGIN_BUILD) +#ifdef BUILTIN_LDAP #include "array.h" #include "str.h" diff --git a/src/lib-dict-backend/dict-ldap.c b/src/lib-dict-backend/dict-ldap.c index 433871b980..5778abb47b 100644 --- a/src/lib-dict-backend/dict-ldap.c +++ b/src/lib-dict-backend/dict-ldap.c @@ -2,10 +2,9 @@ #include "lib.h" -#if defined(BUILTIN_LDAP) || defined(PLUGIN_BUILD) +#ifdef BUILTIN_LDAP #include "array.h" -#include "module-dir.h" #include "str.h" #include "istream.h" #include "ostream.h" @@ -478,23 +477,4 @@ struct dict dict_driver_ldap = { } }; -#ifndef BUILTIN_LDAP -/* Building a plugin */ -void dict_ldap_init(struct module *module ATTR_UNUSED); -void dict_ldap_deinit(void); - -void dict_ldap_init(struct module *module ATTR_UNUSED) -{ - dict_driver_register(&dict_driver_ldap); -} - -void dict_ldap_deinit(void) -{ - ldap_clients_cleanup(); - dict_driver_unregister(&dict_driver_ldap); -} - -const char *dict_ldap_plugin_dependencies[] = { NULL }; -#endif - #endif diff --git a/src/master/main.c b/src/master/main.c index 8c4c3e6518..00eda1d542 100644 --- a/src/master/main.c +++ b/src/master/main.c @@ -737,9 +737,6 @@ static void print_build_options(void) #endif #ifdef USERDB_LDAP " ldap" -#ifndef BUILTIN_LDAP - "(plugin)" -#endif #endif #ifdef USERDB_NSS " nss"