/* 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>
NULL,
NULL
};
-
+#else
+struct passdb_module_interface passdb_bsdauth = {
+ MEMBER(name) "bsdauth"
+};
#endif
/* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
+#include "passdb.h"
#ifdef PASSDB_CHECKPASSWORD
#include "ioloop.h"
#include "hash.h"
#include "env-util.h"
-#include "passdb.h"
#include "safe-memset.h"
#include <stdlib.h>
NULL,
NULL
};
-
+#else
+struct passdb_module_interface passdb_checkpassword = {
+ MEMBER(name) "checkpassword"
+};
#endif
/* Copyright (c) 2003-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
+#include "passdb.h"
#ifdef PASSDB_LDAP
#include "password-scheme.h"
#include "auth-cache.h"
#include "db-ldap.h"
-#include "passdb.h"
#include <ldap.h>
#include <stdlib.h>
ldap_lookup_credentials,
NULL
};
-
+#else
+struct passdb_module_interface passdb_ldap = {
+ MEMBER(name) "ldap"
+};
#endif
*/
#include "common.h"
+#include "passdb.h"
#ifdef PASSDB_PAM
#include "str.h"
#include "var-expand.h"
#include "network.h"
-#include "passdb.h"
#include "safe-memset.h"
#include "auth-cache.h"
NULL,
NULL
};
-
+#else
+struct passdb_module_interface passdb_pam = {
+ MEMBER(name) "pam"
+};
#endif
/* 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"
passwd_file_lookup_credentials,
NULL
};
-
+#else
+struct passdb_module_interface passdb_passwd_file = {
+ MEMBER(name) "passwd-file"
+};
#endif
/* 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>
NULL
};
+#else
+struct passdb_module_interface passdb_passwd = {
+ MEMBER(name) "passwd"
+};
#endif
/* 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>
NULL,
NULL
};
-
+#else
+struct passdb_module_interface passdb_shadow = {
+ MEMBER(name) "shadow"
+};
#endif
/* 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>
NULL,
NULL
};
-
+#else
+struct passdb_module_interface passdb_sia = {
+ MEMBER(name) "sia"
+};
#endif
/* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
+#include "passdb.h"
#ifdef PASSDB_SQL
#include "password-scheme.h"
#include "auth-cache.h"
#include "db-sql.h"
-#include "passdb.h"
#include <stdlib.h>
#include <string.h>
sql_lookup_credentials,
sql_set_credentials
};
-
+#else
+struct passdb_module_interface passdb_sql = {
+ MEMBER(name) "sql"
+};
#endif
/* 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"
vpopmail_lookup_credentials,
NULL
};
-
+#else
+struct passdb_module_interface passdb_vpopmail = {
+ MEMBER(name) "vpopmail"
+};
#endif
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);
}
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)
/* Copyright (c) 2003-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
+#include "userdb.h"
#ifdef USERDB_LDAP
#include "var-expand.h"
#include "auth-cache.h"
#include "db-ldap.h"
-#include "userdb.h"
#include <ldap.h>
#include <stdlib.h>
userdb_ldap_lookup
};
-
+#else
+struct userdb_module_interface userdb_ldap = {
+ MEMBER(name) "ldap"
+};
#endif
/* 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>
userdb_nss_lookup
};
-
+#else
+struct userdb_module_interface userdb_nss = {
+ MEMBER(name) "nss"
+};
#endif
/* 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"
passwd_file_lookup
};
-
+#else
+struct userdb_module_interface userdb_passwd_file = {
+ MEMBER(name) "passwd-file"
+};
#endif
/* 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>
passwd_lookup
};
-
+#else
+struct userdb_module_interface userdb_passwd = {
+ MEMBER(name) "passwd"
+};
#endif
/* 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>
prefetch_lookup
};
-
+#else
+struct userdb_module_interface userdb_prefetch = {
+ MEMBER(name) "prefetch"
+};
#endif
/* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
+#include "userdb.h"
#ifdef USERDB_SQL
#include "var-expand.h"
#include "auth-cache.h"
#include "db-sql.h"
-#include "userdb.h"
#include <stdlib.h>
#include <string.h>
userdb_sql_lookup
};
-
+#else
+struct userdb_module_interface userdb_sql = {
+ MEMBER(name) "sql"
+};
#endif
static_lookup
};
-
+#else
+struct userdb_module_interface userdb_static = {
+ MEMBER(name) "static"
+};
#endif
/* 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 {
return vpw;
}
+#endif
#ifdef USERDB_VPOPMAIL
-
static const char *
userdb_vpopmail_get_quota(const char *template, const char *vpop_str)
{
vpopmail_lookup
};
-
-#endif
+#else
+struct userdb_module_interface userdb_vpopmail = {
+ MEMBER(name) "vpopmail"
+};
#endif
*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);
}
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)