]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Separate "unknown passdb/userdb X" and "support for X not compiled in" error messages.
authorTimo Sirainen <tss@iki.fi>
Wed, 24 Sep 2008 16:01:23 +0000 (19:01 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 24 Sep 2008 16:01:23 +0000 (19:01 +0300)
--HG--
branch : HEAD

20 files changed:
src/auth/passdb-bsdauth.c
src/auth/passdb-checkpassword.c
src/auth/passdb-ldap.c
src/auth/passdb-pam.c
src/auth/passdb-passwd-file.c
src/auth/passdb-passwd.c
src/auth/passdb-shadow.c
src/auth/passdb-sia.c
src/auth/passdb-sql.c
src/auth/passdb-vpopmail.c
src/auth/passdb.c
src/auth/userdb-ldap.c
src/auth/userdb-nss.c
src/auth/userdb-passwd-file.c
src/auth/userdb-passwd.c
src/auth/userdb-prefetch.c
src/auth/userdb-sql.c
src/auth/userdb-static.c
src/auth/userdb-vpopmail.c
src/auth/userdb.c

index 5e33926ae2200233a9fc323c63cff62ea6aa5dbb..12b850fa5fa5ccf21e318248df897d0271534b26 100644 (file)
@@ -1,11 +1,11 @@
 /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_BSDAUTH
 
 #include "safe-memset.h"
-#include "passdb.h"
 #include "mycrypt.h"
 
 #include <login_cap.h>
@@ -78,5 +78,8 @@ struct passdb_module_interface passdb_bsdauth = {
        NULL,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_bsdauth = {
+       MEMBER(name) "bsdauth"
+};
 #endif
index 76ffe4e93f9f573c61082fbc044b9e653f3853f2..eb50b7cfd210ba22dcd440f6d459e2758fcda3e5 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_CHECKPASSWORD
 
@@ -10,7 +11,6 @@
 #include "ioloop.h"
 #include "hash.h"
 #include "env-util.h"
-#include "passdb.h"
 #include "safe-memset.h"
 
 #include <stdlib.h>
@@ -478,5 +478,8 @@ struct passdb_module_interface passdb_checkpassword = {
        NULL,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_checkpassword = {
+       MEMBER(name) "checkpassword"
+};
 #endif
index 17b3a452d64e9cad08f5de6a61de0c8dcc9fbd5a..7c59add163aedfea143c6fae883d1ce59a8657da 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2003-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_LDAP
 
@@ -11,7 +12,6 @@
 #include "password-scheme.h"
 #include "auth-cache.h"
 #include "db-ldap.h"
-#include "passdb.h"
 
 #include <ldap.h>
 #include <stdlib.h>
@@ -430,5 +430,8 @@ struct passdb_module_interface passdb_ldap = {
        ldap_lookup_credentials,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_ldap = {
+       MEMBER(name) "ldap"
+};
 #endif
index 8621fb1bac8eef91f4c7aaafd789089f0f024b26..0b847d0b50963d6db6fc4b0fb171c4d980c2380d 100644 (file)
@@ -8,6 +8,7 @@
 */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_PAM
 
@@ -15,7 +16,6 @@
 #include "str.h"
 #include "var-expand.h"
 #include "network.h"
-#include "passdb.h"
 #include "safe-memset.h"
 #include "auth-cache.h"
 
@@ -320,5 +320,8 @@ struct passdb_module_interface passdb_pam = {
        NULL,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_pam = {
+       MEMBER(name) "pam"
+};
 #endif
index 3bc06d5e616844311fc991a986779791b9a851aa..935c2e02b4e9ec3cc2e06de023d23f58787c9187 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_PASSWD_FILE
 
 #include "str.h"
 #include "auth-cache.h"
 #include "var-expand.h"
-#include "passdb.h"
 #include "password-scheme.h"
 #include "db-passwd-file.h"
 
@@ -187,5 +187,8 @@ struct passdb_module_interface passdb_passwd_file = {
        passwd_file_lookup_credentials,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_passwd_file = {
+       MEMBER(name) "passwd-file"
+};
 #endif
index 39862eeedafb6de477d2eaf6a226404ac1db9a4d..fa50ea28a2c33a41c087fbbfe91ec5a4178de1f1 100644 (file)
@@ -1,11 +1,11 @@
 /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_PASSWD
 
 #include "safe-memset.h"
-#include "passdb.h"
 
 #include <pwd.h>
 
@@ -83,4 +83,8 @@ struct passdb_module_interface passdb_passwd = {
        NULL
 };
 
+#else
+struct passdb_module_interface passdb_passwd = {
+       MEMBER(name) "passwd"
+};
 #endif
index 091a462d8f88c3df0ef0ca188bfbe814cc1369ff..04a95fd0cba1308613db111183405bc217c229b6 100644 (file)
@@ -1,11 +1,11 @@
 /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_SHADOW
 
 #include "safe-memset.h"
-#include "passdb.h"
 
 #include <shadow.h>
 
@@ -82,5 +82,8 @@ struct passdb_module_interface passdb_shadow = {
        NULL,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_shadow = {
+       MEMBER(name) "shadow"
+};
 #endif
index a4d8b320fe976325578f1f1604677f26896dd21a..a7ebae7146823a3290a7972a629926bd12c8cb74 100644 (file)
@@ -3,11 +3,11 @@
 /* Tru64 SIA support */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_SIA
 
 #include "safe-memset.h"
-#include "passdb.h"
 
 #include <sia.h>
 #include <siad.h>
@@ -59,5 +59,8 @@ struct passdb_module_interface passdb_sia = {
        NULL,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_sia = {
+       MEMBER(name) "sia"
+};
 #endif
index ac5e536212d5e32c326e5f6b82b3f6b5c3bf1590..c40f0937ca4cc162443c30bc61c9e30fcf18c7ff 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_SQL
 
@@ -11,7 +12,6 @@
 #include "password-scheme.h"
 #include "auth-cache.h"
 #include "db-sql.h"
-#include "passdb.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -273,5 +273,8 @@ struct passdb_module_interface passdb_sql = {
        sql_lookup_credentials,
        sql_set_credentials
 };
-
+#else
+struct passdb_module_interface passdb_sql = {
+       MEMBER(name) "sql"
+};
 #endif
index 47ed4a80bc6b9966a8d292f15c5240ff681c8981..4f072f00043755ab3a9afd829a1bf8137a10e11c 100644 (file)
@@ -3,11 +3,11 @@
 /* Thanks to Courier-IMAP for showing how the vpopmail API should be used */
 
 #include "common.h"
+#include "passdb.h"
 
 #ifdef PASSDB_VPOPMAIL
 
 #include "safe-memset.h"
-#include "passdb.h"
 #include "password-scheme.h"
 #include "auth-cache.h"
 
@@ -194,5 +194,8 @@ struct passdb_module_interface passdb_vpopmail = {
        vpopmail_lookup_credentials,
        NULL
 };
-
+#else
+struct passdb_module_interface passdb_vpopmail = {
+       MEMBER(name) "vpopmail"
+};
 #endif
index 2f320061acab076304983aa75d0707e565b39d6f..12f841cd97bc67f6e087120ba7ac78977dd0c19e 100644 (file)
@@ -139,10 +139,10 @@ struct auth_passdb *passdb_preinit(struct auth *auth, const char *driver,
         auth_passdb->id = id;
 
        iface = passdb_interface_find(driver);
-       if (iface == NULL) {
-               i_fatal("Unknown passdb driver '%s' "
-                       "(typo, or Dovecot was built without support for it? "
-                       "Check with dovecot --build-options)",
+       if (iface == NULL)
+               i_fatal("Unknown passdb driver '%s'", driver);
+       if (iface->verify_plain == NULL) {
+               i_fatal("Support not compiled in for passdb driver '%s'",
                        driver);
        }
 
@@ -191,36 +191,16 @@ extern struct passdb_module_interface passdb_sia;
 void passdbs_init(void)
 {
        i_array_init(&passdb_interfaces, 16);
-#ifdef PASSDB_PASSWD
        passdb_register_module(&passdb_passwd);
-#endif
-#ifdef PASSDB_BSDAUTH
        passdb_register_module(&passdb_bsdauth);
-#endif
-#ifdef PASSDB_PASSWD_FILE
        passdb_register_module(&passdb_passwd_file);
-#endif
-#ifdef PASSDB_PAM
        passdb_register_module(&passdb_pam);
-#endif
-#ifdef PASSDB_CHECKPASSWORD
        passdb_register_module(&passdb_checkpassword);
-#endif
-#ifdef PASSDB_SHADOW
        passdb_register_module(&passdb_shadow);
-#endif
-#ifdef PASSDB_VPOPMAIL
        passdb_register_module(&passdb_vpopmail);
-#endif
-#if defined(PASSDB_LDAP) && defined(BUILTIN_LDAP)
        passdb_register_module(&passdb_ldap);
-#endif
-#ifdef PASSDB_SQL
        passdb_register_module(&passdb_sql);
-#endif
-#ifdef PASSDB_SIA
        passdb_register_module(&passdb_sia);
-#endif
 }
 
 void passdbs_deinit(void)
index 5d22a6f8e5c7b1d68bb053f36702922797ec5fe3..c6e488d0a3d4edcb5c65e952b5fc03dd27f875d2 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2003-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "userdb.h"
 
 #ifdef USERDB_LDAP
 
@@ -9,7 +10,6 @@
 #include "var-expand.h"
 #include "auth-cache.h"
 #include "db-ldap.h"
-#include "userdb.h"
 
 #include <ldap.h>
 #include <stdlib.h>
@@ -161,5 +161,8 @@ struct userdb_module_interface userdb_ldap = {
 
        userdb_ldap_lookup
 };
-
+#else
+struct userdb_module_interface userdb_ldap = {
+       MEMBER(name) "ldap"
+};
 #endif
index acc2f4976b44b3201f4353046b1f1a77dc1919a2..fae6cab441a00078a56ccdbebd44751aea06d47d 100644 (file)
@@ -3,11 +3,11 @@
 /* Currently supports only GLIBC-compatible NSS modules */
 
 #include "common.h"
+#include "userdb.h"
 
 #ifdef USERDB_NSS
 
 #include "module-dir.h"
-#include "userdb.h"
 
 #include <pwd.h>
 #include <unistd.h>
@@ -148,5 +148,8 @@ struct userdb_module_interface userdb_nss = {
 
        userdb_nss_lookup
 };
-
+#else
+struct userdb_module_interface userdb_nss = {
+       MEMBER(name) "nss"
+};
 #endif
index 0b61fba2c2a1e31dcba05d97cc4a0eefb68bd797..5e2635a9d395bc8c6b86ebac4262098f515a2eb5 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "userdb.h"
 
 #ifdef USERDB_PASSWD_FILE
 
 #include "str.h"
 #include "auth-cache.h"
 #include "var-expand.h"
-#include "userdb.h"
 #include "db-passwd-file.h"
 
 #define PASSWD_FILE_CACHE_KEY "%u"
@@ -137,5 +137,8 @@ struct userdb_module_interface userdb_passwd_file = {
 
        passwd_file_lookup
 };
-
+#else
+struct userdb_module_interface userdb_passwd_file = {
+       MEMBER(name) "passwd-file"
+};
 #endif
index c4767e9fd3485acd6710fbda1bf39427ad628e33..3720c7006b8eb4f456fc1a74c1bec2563e835707 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "userdb.h"
 
 #ifdef USERDB_PASSWD
 
-#include "userdb.h"
 #include "userdb-static.h"
 
 #include <pwd.h>
@@ -92,5 +92,8 @@ struct userdb_module_interface userdb_passwd = {
 
        passwd_lookup
 };
-
+#else
+struct userdb_module_interface userdb_passwd = {
+       MEMBER(name) "passwd"
+};
 #endif
index 7471b9a655a8a2c81b88723aeb9aeaf82d23d9ea..02b15a4e4b89031191694f8bf4a7fe43e32c71af 100644 (file)
@@ -1,12 +1,12 @@
 /* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "userdb.h"
 
 #ifdef USERDB_PREFETCH
 
 #include "str.h"
 #include "var-expand.h"
-#include "userdb.h"
 
 #include <stdlib.h>
 
@@ -44,5 +44,8 @@ struct userdb_module_interface userdb_prefetch = {
 
        prefetch_lookup
 };
-
+#else
+struct userdb_module_interface userdb_prefetch = {
+       MEMBER(name) "prefetch"
+};
 #endif
index 7afb36f5ababb702c2564a4f4af2cd64d39e23d0..59401b9025c8288b8feed9dadb59e0dbea83bee3 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
 
 #include "common.h"
+#include "userdb.h"
 
 #ifdef USERDB_SQL
 
@@ -9,7 +10,6 @@
 #include "var-expand.h"
 #include "auth-cache.h"
 #include "db-sql.h"
-#include "userdb.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -151,5 +151,8 @@ struct userdb_module_interface userdb_sql = {
 
        userdb_sql_lookup
 };
-
+#else
+struct userdb_module_interface userdb_sql = {
+       MEMBER(name) "sql"
+};
 #endif
index 3351f1385af4987240e71ce59d60119e96ac83aa..90d650701562ba53ef821b2da9faab4e5f29e04b 100644 (file)
@@ -238,5 +238,8 @@ struct userdb_module_interface userdb_static = {
 
        static_lookup
 };
-
+#else
+struct userdb_module_interface userdb_static = {
+       MEMBER(name) "static"
+};
 #endif
index c2e5103fd6830316fd869e8b7fa2244d95bd8927..feabc1846949a2bcc136ecd4fde2fd9004836b76 100644 (file)
@@ -3,11 +3,11 @@
 /* Thanks to Courier-IMAP for showing how the vpopmail API should be used */
 
 #include "common.h"
+#include "userdb.h"
 
 #if defined(PASSDB_VPOPMAIL) || defined(USERDB_VPOPMAIL)
 #include "str.h"
 #include "var-expand.h"
-#include "userdb.h"
 #include "userdb-vpopmail.h"
 
 struct vpopmail_userdb_module {
@@ -48,9 +48,9 @@ struct vqpasswd *vpopmail_lookup_vqp(struct auth_request *request,
 
        return vpw;
 }
+#endif
 
 #ifdef USERDB_VPOPMAIL
-
 static const char *
 userdb_vpopmail_get_quota(const char *template, const char *vpop_str)
 {
@@ -172,6 +172,8 @@ struct userdb_module_interface userdb_vpopmail = {
 
        vpopmail_lookup
 };
-
-#endif
+#else
+struct userdb_module_interface userdb_vpopmail = {
+       MEMBER(name) "vpopmail"
+};
 #endif
index 9e9ddd0e7de1414d8de454f687a68c0d64eb247f..bcb0c602c368a77fbaebe67bf1a55af6bcb2ddba 100644 (file)
@@ -116,10 +116,10 @@ void userdb_preinit(struct auth *auth, const char *driver, const char *args)
        *dest = auth_userdb;
 
        iface = userdb_interface_find(driver);
-       if (iface == NULL) {
-               i_fatal("Unknown userdb driver '%s' "
-                       "(typo, or Dovecot was built without support for it? "
-                       "Check with dovecot --build-options)",
+       if (iface == NULL)
+               i_fatal("Unknown userdb driver '%s'", driver);
+       if (iface->lookup == NULL) {
+               i_fatal("Support not compiled in for userdb driver '%s'",
                        driver);
        }
 
@@ -162,30 +162,14 @@ extern struct userdb_module_interface userdb_nss;
 void userdbs_init(void)
 {
        i_array_init(&userdb_interfaces, 16);
-#ifdef USERDB_PASSWD
        userdb_register_module(&userdb_passwd);
-#endif
-#ifdef USERDB_PASSWD_FILE
        userdb_register_module(&userdb_passwd_file);
-#endif
-#ifdef USERDB_PREFETCH
        userdb_register_module(&userdb_prefetch);
-#endif
-#ifdef USERDB_STATIC
        userdb_register_module(&userdb_static);
-#endif
-#ifdef USERDB_VPOPMAIL
        userdb_register_module(&userdb_vpopmail);
-#endif
-#if defined(USERDB_LDAP) && defined(BUILTIN_LDAP)
        userdb_register_module(&userdb_ldap);
-#endif
-#ifdef USERDB_SQL
        userdb_register_module(&userdb_sql);
-#endif
-#ifdef USERDB_NSS
        userdb_register_module(&userdb_nss);
-#endif
 }
 
 void userdbs_deinit(void)