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