userdb.c revision 747e77e3ab073a8e9e69c7a3e71b4593c5655d03
5a580c3a38ced62d4bcc95b8ac7c4f2935b5d294Timo Sirainen/* Copyright (C) 2002-2003 Timo Sirainen */
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschextern struct userdb_module_interface userdb_prefetch;
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschextern struct userdb_module_interface userdb_static;
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschextern struct userdb_module_interface userdb_passwd;
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschextern struct userdb_module_interface userdb_passwd_file;
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschextern struct userdb_module_interface userdb_vpopmail;
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschextern struct userdb_module_interface userdb_ldap;
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschextern struct userdb_module_interface userdb_sql;
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschstruct userdb_module_interface *userdb_interfaces[] = {
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschuid_t userdb_parse_uid(struct auth_request *request, const char *str)
4d955db590c3d76a631dfc5d37bcdf578a43e55aStephan Boschgid_t userdb_parse_gid(struct auth_request *request, const char *str)
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Boschvoid userdb_preinit(struct auth *auth, const char *driver, const char *args)
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen auth_userdb = p_new(auth->pool, struct auth_userdb, 1);
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch auth_userdb->args = p_strdup(auth->pool, args);
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch for (dest = &auth->userdbs; *dest != NULL; dest = &(*dest)->next)
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch for (p = userdb_interfaces; *p != NULL; p++) {
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch auth_userdb->module = auth_module_open(driver);
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch "(typo, or Dovecot was built without support for it? "
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch "Check with dovecot --build-options)",
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch iface->preinit(auth_userdb, auth_userdb->args);
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch userdb->userdb->iface->init(userdb->userdb, userdb->args);
8fe8f97e688779add9cd042a9db4ddb7b117cce2Stephan Bosch /* blocking userdb - we need an auth server */