]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth_userdb and auth_passdb no longer has pointer to struct auth.
authorTimo Sirainen <tss@iki.fi>
Sat, 13 Mar 2010 15:28:18 +0000 (17:28 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 13 Mar 2010 15:28:18 +0000 (17:28 +0200)
--HG--
branch : HEAD

26 files changed:
src/auth/auth-request.c
src/auth/auth-settings.c
src/auth/auth-settings.h
src/auth/auth-worker-server.c
src/auth/auth-worker-server.h
src/auth/auth.h
src/auth/main.c
src/auth/passdb-blocking.c
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-sql.c
src/auth/passdb-vpopmail.c
src/auth/passdb.c
src/auth/userdb-blocking.c
src/auth/userdb-checkpassword.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-sql.c
src/auth/userdb-static.c
src/auth/userdb-vpopmail.c
src/auth/userdb.c

index bec6fbcb56858dfd0b7d14b90eddafb99307bf6c..45c9d08d9b523158d2f222df8630206e5333d429 100644 (file)
@@ -63,6 +63,10 @@ struct auth_request *auth_request_new_dummy(struct auth *auth)
        auth_request->refcount = 1;
        auth_request->last_access = ioloop_time;
 
+       if (auth == NULL) {
+               auth = p_new(pool, struct auth, 1);
+               auth->set = global_auth_settings;
+       }
        auth_request->auth = auth;
        auth_request->passdb = auth->passdbs;
        auth_request->userdb = auth->userdbs;
index d50cd77dfef854278a693fd248b1e1bab4d2b166..522bad36afd848bd6999d0ad0ebff22993cca67f 100644 (file)
@@ -288,6 +288,8 @@ auth_userdb_settings_check(void *_set, pool_t pool ATTR_UNUSED,
 }
 /* </settings checks> */
 
+struct auth_settings *global_auth_settings;
+
 struct auth_settings *
 auth_settings_read(struct master_service *service)
 {
index 3972bb14ecdebe8e3ec9da0106da001aaf425265..bd7b7df4938f47199c2a532f813de2fc7c271943 100644 (file)
@@ -50,6 +50,8 @@ struct auth_settings {
        const char *const *realms_arr;
 };
 
+extern struct auth_settings *global_auth_settings;
+
 struct auth_settings *auth_settings_read(struct master_service *service);
 
 #endif
index 34df86bf1a040a2717b112d6dc916ebaebebc78b..7767b4409602ba28919a2f986ccbe74cb49bf782 100644 (file)
@@ -28,7 +28,6 @@ struct auth_worker_request {
 };
 
 struct auth_worker_connection {
-       struct auth *auth;
        int fd;
 
        struct io *io;
@@ -120,12 +119,12 @@ static void auth_worker_request_send_next(struct auth_worker_connection *conn)
        auth_worker_request_send(conn, request);
 }
 
-static struct auth_worker_connection *auth_worker_create(struct auth *auth)
+static struct auth_worker_connection *auth_worker_create(void)
 {
        struct auth_worker_connection *conn;
        int fd;
 
-       if (array_count(&connections) >= auth->set->worker_max_count)
+       if (array_count(&connections) >= global_auth_settings->worker_max_count)
                return NULL;
 
        fd = net_connect_unix_with_retries(worker_socket_path, 5000);
@@ -135,7 +134,6 @@ static struct auth_worker_connection *auth_worker_create(struct auth *auth)
        }
 
        conn = i_new(struct auth_worker_connection, 1);
-       conn->auth = auth;
        conn->fd = fd;
        conn->input = i_stream_create_fd(fd, AUTH_WORKER_MAX_LINE_LENGTH,
                                         FALSE);
@@ -154,7 +152,6 @@ static void auth_worker_destroy(struct auth_worker_connection **_conn,
                                const char *reason, bool restart)
 {
        struct auth_worker_connection *conn = *_conn;
-       struct auth *auth = conn->auth;
        struct auth_worker_connection *const *conns;
        unsigned int idx;
 
@@ -188,7 +185,7 @@ static void auth_worker_destroy(struct auth_worker_connection **_conn,
        i_free(conn);
 
        if (idle_count == 0 && restart) {
-               conn = auth_worker_create(auth);
+               conn = auth_worker_create();
                auth_worker_request_send_next(conn);
        }
 }
@@ -286,8 +283,7 @@ static void worker_input(struct auth_worker_connection *conn)
 }
 
 struct auth_worker_connection *
-auth_worker_call(struct auth *auth, pool_t pool,
-                struct auth_stream_reply *data,
+auth_worker_call(pool_t pool, struct auth_stream_reply *data,
                 auth_worker_callback_t *callback, void *context)
 {
        struct auth_worker_connection *conn;
@@ -307,7 +303,7 @@ auth_worker_call(struct auth *auth, pool_t pool,
                conn = auth_worker_find_free();
                if (conn == NULL) {
                        /* no free connections, create a new one */
-                       conn = auth_worker_create(auth);
+                       conn = auth_worker_create();
                }
        }
        if (conn != NULL)
index d9bae6c5c59fc7aa59e7d65db3c44620cfe09bb6..ed492b329e80f72c8b9c47252981c6393f287ce1 100644 (file)
@@ -7,8 +7,7 @@ struct auth_stream_reply;
 typedef bool auth_worker_callback_t(const char *reply, void *context);
 
 struct auth_worker_connection *
-auth_worker_call(struct auth *auth, pool_t pool,
-                struct auth_stream_reply *data,
+auth_worker_call(pool_t pool, struct auth_stream_reply *data,
                 auth_worker_callback_t *callback, void *context);
 void auth_worker_server_resume_input(struct auth_worker_connection *conn);
 
index 9e2e28750dfb09dba7593700c7d26cacce575d04..31958da6e89f4da35e36b1409559720450cfdae1 100644 (file)
@@ -6,7 +6,7 @@
 #define PASSWORD_HIDDEN_STR "<hidden>"
 
 struct auth_passdb {
-       struct auth *auth;
+       pool_t pool;
        struct auth_passdb *next;
 
         /* id is used by blocking passdb to identify the passdb */
@@ -21,7 +21,7 @@ struct auth_passdb {
 };
 
 struct auth_userdb {
-       struct auth *auth;
+       pool_t pool;
        struct auth_userdb *next;
 
        unsigned int num;
index a9edf1e96775ecf6301a3a153df8318cefb1f3d7..fd528dd5f51f6a6739411d31a140603243c6abd2 100644 (file)
@@ -37,7 +37,7 @@ static struct module *modules = NULL;
 static struct auth *auth;
 static ARRAY_DEFINE(listen_fd_types, enum auth_socket_type);
 
-static void main_preinit(struct auth_settings *set)
+static void main_preinit(void)
 {
        struct module_dir_load_settings mod_set;
 
@@ -56,12 +56,12 @@ static void main_preinit(struct auth_settings *set)
        memset(&mod_set, 0, sizeof(mod_set));
        mod_set.version = master_service_get_version_string(master_service);
        mod_set.require_init_funcs = TRUE;
-       mod_set.debug = set->debug;
+       mod_set.debug = global_auth_settings->debug;
 
        modules = module_dir_load(AUTH_MODULE_DIR, NULL, &mod_set);
        module_dir_init(modules);
 
-       auth = auth_preinit(set);
+       auth = auth_preinit(global_auth_settings);
 
        /* Password lookups etc. may require roots, allow it. */
        restrict_access_by_env(NULL, FALSE);
@@ -189,7 +189,8 @@ int main(int argc, char *argv[])
                }
        }
 
-       main_preinit(auth_settings_read(master_service));
+       global_auth_settings = auth_settings_read(master_service);
+       main_preinit();
 
        master_service_init_finish(master_service);
        main_init();
index 3da2802a02f689d6f712b1092913c29e6965cc6f..5a7ca461cd9e341602c890a5377488ba7fe7fc00 100644 (file)
@@ -85,8 +85,7 @@ void passdb_blocking_verify_plain(struct auth_request *request)
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       auth_worker_call(request->auth, request->pool, reply,
-                        verify_plain_callback, request);
+       auth_worker_call(request->pool, reply, verify_plain_callback, request);
 }
 
 static bool lookup_credentials_callback(const char *reply, void *context)
@@ -128,7 +127,7 @@ void passdb_blocking_lookup_credentials(struct auth_request *request)
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       auth_worker_call(request->auth, request->pool, reply,
+       auth_worker_call(request->pool, reply,
                         lookup_credentials_callback, request);
 }
 
@@ -156,6 +155,6 @@ void passdb_blocking_set_credentials(struct auth_request *request,
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       auth_worker_call(request->auth, request->pool, reply,
+       auth_worker_call(request->pool, reply,
                         set_credentials_callback, request);
 }
index 801927f6705cd5af330332eed495130298806045..708dc3dcd6c0d9c63b7e8a915c4221f879a33fef 100644 (file)
@@ -53,13 +53,12 @@ bsdauth_preinit(struct auth_passdb *auth_passdb, const char *args)
 {
        struct passdb_module *module;
 
-       module = p_new(auth_passdb->auth->pool, struct passdb_module, 1);
+       module = p_new(auth_passdb->pool, struct passdb_module, 1);
        module->default_pass_scheme = "PLAIN"; /* same reason as PAM */
 
        if (strncmp(args, "cache_key=", 10) == 0) {
                module->cache_key =
-                       auth_cache_parse_key(auth_passdb->auth->pool,
-                                            args + 10);
+                       auth_cache_parse_key(auth_passdb->pool, args + 10);
        } else if (*args != '\0')
                i_fatal("passdb bsdauth: Unknown setting: %s", args);
        return module;
index 8b2ac31e43ea674fafb2ab4b5d0b064be7c2b067..d0ca024d4843d5240440ab9d8cad17c646ae82a6 100644 (file)
@@ -239,9 +239,9 @@ checkpassword_preinit(struct auth_passdb *auth_passdb, const char *args)
 {
        struct checkpassword_passdb_module *module;
 
-       module = p_new(auth_passdb->auth->pool,
+       module = p_new(auth_passdb->pool,
                       struct checkpassword_passdb_module, 1);
-       module->checkpassword_path = p_strdup(auth_passdb->auth->pool, args);
+       module->checkpassword_path = p_strdup(auth_passdb->pool, args);
        module->checkpassword_reply_path =
                PKG_LIBEXECDIR"/checkpassword-reply";
 
index 5525af53ffba18d07399b15e6c8ef0016ed0ee0b..7df6b2d1959078cb9d481fb123f9e8753efbad53 100644 (file)
@@ -397,7 +397,7 @@ passdb_ldap_preinit(struct auth_passdb *auth_passdb, const char *args)
        struct ldap_passdb_module *module;
        struct ldap_connection *conn;
 
-       module = p_new(auth_passdb->auth->pool, struct ldap_passdb_module, 1);
+       module = p_new(auth_passdb->pool, struct ldap_passdb_module, 1);
        module->conn = conn = db_ldap_init(args);
        conn->pass_attr_map =
                hash_table_create(default_pool, conn->pool, 0, str_hash,
@@ -407,7 +407,7 @@ passdb_ldap_preinit(struct auth_passdb *auth_passdb, const char *args)
                          conn->pass_attr_map,
                          conn->set.auth_bind ? "password" : NULL);
        module->module.cache_key =
-               auth_cache_parse_key(auth_passdb->auth->pool,
+               auth_cache_parse_key(auth_passdb->pool,
                                     t_strconcat(conn->set.base,
                                                 conn->set.pass_filter, NULL));
        module->module.default_pass_scheme = conn->set.default_pass_scheme;
index 17977a67b95a63808a2401419c6eb0b391ff7b85..1d42d7f7eefbde4a80c2201ed36f6bfa6d0cda9d 100644 (file)
@@ -333,7 +333,7 @@ pam_preinit(struct auth_passdb *auth_passdb, const char *args)
        const char *const *t_args;
        int i;
 
-       module = p_new(auth_passdb->auth->pool, struct pam_passdb_module, 1);
+       module = p_new(auth_passdb->pool, struct pam_passdb_module, 1);
        module->service_name = "dovecot";
        /* we're caching the password by using directly the plaintext password
           given by the auth mechanism */
@@ -351,7 +351,7 @@ pam_preinit(struct auth_passdb *auth_passdb, const char *args)
                        module->pam_setcred = TRUE;
                else if (strncmp(t_args[i], "cache_key=", 10) == 0) {
                        module->module.cache_key =
-                               auth_cache_parse_key(auth_passdb->auth->pool,
+                               auth_cache_parse_key(auth_passdb->pool,
                                                     t_args[i] + 10);
                } else if (strcmp(t_args[i], "blocking=yes") == 0) {
                        /* ignore, for backwards compatibility */
@@ -364,7 +364,7 @@ pam_preinit(struct auth_passdb *auth_passdb, const char *args)
                        module->requests_left = atoi(t_args[i] + 13);
                } else if (t_args[i+1] == NULL) {
                        module->service_name =
-                               p_strdup(auth_passdb->auth->pool, t_args[i]);
+                               p_strdup(auth_passdb->pool, t_args[i]);
                } else {
                        i_fatal("passdb pam: Unknown setting: %s", t_args[i]);
                }
index 49da1e60b40ab1d0b3131f1d2518bdec096e0bdc..42b2f718315ddf04807377fc323541ca6f81fa18 100644 (file)
@@ -14,7 +14,6 @@
 struct passwd_file_passdb_module {
        struct passdb_module module;
 
-       struct auth *auth;
        struct db_passwd_file *pwf;
 };
 
@@ -136,9 +135,9 @@ passwd_file_preinit(struct auth_passdb *auth_passdb, const char *args)
                        args++;
 
                if (strcmp(key, "scheme") == 0)
-                       scheme = p_strdup(auth_passdb->auth->pool, value);
+                       scheme = p_strdup(auth_passdb->pool, value);
                else if (strcmp(key, "username_format") == 0)
-                       format = p_strdup(auth_passdb->auth->pool, value);
+                       format = p_strdup(auth_passdb->pool, value);
                else
                        i_fatal("passdb passwd-file: Unknown setting: %s", key);
        }
@@ -146,17 +145,15 @@ passwd_file_preinit(struct auth_passdb *auth_passdb, const char *args)
        if (*args == '\0')
                i_fatal("passdb passwd-file: Missing args");
 
-       module = p_new(auth_passdb->auth->pool,
-                      struct passwd_file_passdb_module, 1);
-       module->auth = auth_passdb->auth;
+       module = p_new(auth_passdb->pool, struct passwd_file_passdb_module, 1);
        module->pwf = db_passwd_file_init(args, format, FALSE,
-                                         module->auth->set->debug);
+                                         global_auth_settings->debug);
 
        if (!module->pwf->vars)
                module->module.cache_key = format;
        else {
                module->module.cache_key =
-                       auth_cache_parse_key(auth_passdb->auth->pool,
+                       auth_cache_parse_key(auth_passdb->pool,
                                t_strconcat(format, module->pwf->path, NULL));
        }
 
index 167129f7ef4cef2d41fdc8c03d3038da1ec78439..2b54a0f6330a7460cf3c2af809383fa7e123aa39 100644 (file)
@@ -230,11 +230,11 @@ passdb_sql_preinit(struct auth_passdb *auth_passdb, const char *args)
        struct sql_passdb_module *module;
        struct sql_connection *conn;
 
-       module = p_new(auth_passdb->auth->pool, struct sql_passdb_module, 1);
+       module = p_new(auth_passdb->pool, struct sql_passdb_module, 1);
        module->conn = conn = db_sql_init(args);
 
        module->module.cache_key =
-               auth_cache_parse_key(auth_passdb->auth->pool,
+               auth_cache_parse_key(auth_passdb->pool,
                                     conn->set.password_query);
        module->module.default_pass_scheme = conn->set.default_pass_scheme;
        return &module->module;
index 71ce5a7e4e70a4555da0d68ced432f3abf47e57e..dc4532ff0542f86afe3eae1b5f9449f6d5c4a1e5 100644 (file)
@@ -164,15 +164,14 @@ vpopmail_preinit(struct auth_passdb *auth_passdb, const char *args)
        struct vpopmail_passdb_module *module;
        const char *const *tmp;
 
-       module = p_new(auth_passdb->auth->pool,
-                      struct vpopmail_passdb_module, 1);
+       module = p_new(auth_passdb->pool, struct vpopmail_passdb_module, 1);
        module->module.default_pass_scheme = VPOPMAIL_DEFAULT_PASS_SCHEME;
 
        tmp = t_strsplit_spaces(args, " ");
        for (; *tmp != NULL; tmp++) {
                if (strncmp(*tmp, "cache_key=", 10) == 0) {
                        module->module.cache_key =
-                               auth_cache_parse_key(auth_passdb->auth->pool,
+                               auth_cache_parse_key(auth_passdb->pool,
                                                     *tmp + 10);
                } else if (strncmp(*tmp, "webmail=", 8) == 0) {
                        if (net_addr2ip(*tmp + 8, &module->webmail_ip) < 0)
index 5fb7fddecc7d6701b631075679266c818f94566e..2c8d190bd0bc2fe41ea281f48bb6608a7c6485d5 100644 (file)
@@ -161,7 +161,7 @@ passdb_preinit(struct auth *auth, struct auth_passdb_settings *set)
         struct auth_passdb *auth_passdb, **dest;
 
        auth_passdb = p_new(auth->pool, struct auth_passdb, 1);
-       auth_passdb->auth = auth;
+       auth_passdb->pool = auth->pool;
        auth_passdb->args = set->args == NULL ? "" :
                p_strdup(auth->pool, set->args);
        auth_passdb->deny = set->deny;
index cfcd804704b1338147350018bd02a9cb54dfa3ef..b6371f47a87422363e9433e301f72b9272f53fea 100644 (file)
@@ -48,8 +48,7 @@ void userdb_blocking_lookup(struct auth_request *request)
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       auth_worker_call(request->auth, request->pool, reply,
-                        user_callback, request);
+       auth_worker_call(request->pool, reply, user_callback, request);
 }
 
 static bool iter_callback(const char *reply, void *context)
@@ -89,8 +88,7 @@ userdb_blocking_iter_init(struct auth_userdb *userdb,
        ctx->ctx.context = context;
        ctx->pool = pool;
 
-       ctx->conn = auth_worker_call(userdb->auth, pool, reply,
-                                    iter_callback, ctx);
+       ctx->conn = auth_worker_call(pool, reply, iter_callback, ctx);
        return &ctx->ctx;
 }
 
index 55b6e0af4a37245705c81f41c4493c8de92db835..e6c0432672656bffb5f8c58d85a3cc9e630c0c43 100644 (file)
@@ -222,9 +222,9 @@ checkpassword_preinit(struct auth_userdb *auth_userdb, const char *args)
 {
        struct checkpassword_userdb_module *module;
 
-       module = p_new(auth_userdb->auth->pool,
+       module = p_new(auth_userdb->pool,
                       struct checkpassword_userdb_module, 1);
-       module->checkpassword_path = p_strdup(auth_userdb->auth->pool, args);
+       module->checkpassword_path = p_strdup(auth_userdb->pool, args);
        module->checkpassword_reply_path =
                PKG_LIBEXECDIR"/checkpassword-reply";
 
index ebecbc4ad8ee1b5584dece125bf9198629ca9839..0ef9e5003078183ce41726b7333733d2592782b3 100644 (file)
@@ -35,7 +35,7 @@ struct userdb_iter_ldap_request {
 struct ldap_userdb_iterate_context {
        struct userdb_iterate_context ctx;
        struct userdb_iter_ldap_request request;
-       struct auth *auth;
+       pool_t pool;
        struct ldap_connection *conn;
        bool continued, in_callback;
 };
@@ -189,18 +189,16 @@ userdb_ldap_iterate_init(struct auth_userdb *userdb,
        ctx->ctx.userdb = userdb->userdb;
        ctx->ctx.callback = callback;
        ctx->ctx.context = context;
-       ctx->auth = userdb->auth;
        ctx->conn = conn;
        request = &ctx->request;
        request->ctx = ctx;
 
-       request->request.request.auth_request =
-               auth_request_new_dummy(userdb->auth);
+       request->request.request.auth_request = auth_request_new_dummy(NULL);
        request->request.base = conn->set.base;
        request->request.filter = conn->set.iterate_filter;
        request->request.attributes = conn->iterate_attr_names;
 
-       if (userdb->auth->set->debug) {
+       if (global_auth_settings->debug) {
                i_debug("ldap: iterate: base=%s scope=%s filter=%s fields=%s",
                        conn->set.base, conn->set.scope,
                        request->request.filter, attr_names == NULL ? "(all)" :
@@ -239,7 +237,7 @@ userdb_ldap_preinit(struct auth_userdb *auth_userdb, const char *args)
        struct ldap_userdb_module *module;
        struct ldap_connection *conn;
 
-       module = p_new(auth_userdb->auth->pool, struct ldap_userdb_module, 1);
+       module = p_new(auth_userdb->pool, struct ldap_userdb_module, 1);
        module->conn = conn = db_ldap_init(args);
        conn->user_attr_map =
                hash_table_create(default_pool, conn->pool, 0, str_hash,
@@ -254,7 +252,7 @@ userdb_ldap_preinit(struct auth_userdb *auth_userdb, const char *args)
                          &conn->iterate_attr_names,
                          conn->iterate_attr_map, NULL);
        module->module.cache_key =
-               auth_cache_parse_key(auth_userdb->auth->pool,
+               auth_cache_parse_key(auth_userdb->pool,
                                     t_strconcat(conn->set.base,
                                                 conn->set.user_filter, NULL));
        return &module->module;
index 7fc27d85e9095fd3edb77e570296dafb857f748a..ad9494aa290703283b6764c135b96e3e9bfe435c 100644 (file)
@@ -105,7 +105,7 @@ userdb_nss_preinit(struct auth_userdb *auth_userdb, const char *args)
 {
        struct nss_userdb_module *module;
        const char *const *tmp;
-       pool_t pool = auth_userdb->auth->pool;
+       pool_t pool = auth_userdb->pool;
 
        module = p_new(pool, struct nss_userdb_module, 1);
        module->bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
index f343bcd345f0417278309507cd9ad31887cffea4..50ef25a92df41e9c34d6a755bb299e71d9ffbc5c 100644 (file)
@@ -25,7 +25,6 @@ struct passwd_file_userdb_iterate_context {
 struct passwd_file_userdb_module {
         struct userdb_module module;
 
-       struct auth *auth;
        struct db_passwd_file *pwf;
 };
 
@@ -168,8 +167,7 @@ passwd_file_preinit(struct auth_userdb *auth_userdb, const char *args)
                        format = args;
                        args = "";
                } else {
-                       format = p_strdup_until(auth_userdb->auth->pool,
-                                               args, p);
+                       format = p_strdup_until(auth_userdb->pool, args, p);
                        args = p + 1;
                }
        }
@@ -177,17 +175,15 @@ passwd_file_preinit(struct auth_userdb *auth_userdb, const char *args)
        if (*args == '\0')
                i_fatal("userdb passwd-file: Missing args");
 
-       module = p_new(auth_userdb->auth->pool,
-                      struct passwd_file_userdb_module, 1);
-       module->auth = auth_userdb->auth;
+       module = p_new(auth_userdb->pool, struct passwd_file_userdb_module, 1);
        module->pwf = db_passwd_file_init(args, format, TRUE,
-                                         module->auth->set->debug);
+                                         global_auth_settings->debug);
 
        if (!module->pwf->vars)
                module->module.cache_key = PASSWD_FILE_CACHE_KEY;
        else {
                module->module.cache_key =
-                       auth_cache_parse_key(auth_userdb->auth->pool,
+                       auth_cache_parse_key(auth_userdb->pool,
                                             t_strconcat(PASSWD_FILE_CACHE_KEY,
                                                         module->pwf->path,
                                                         NULL));
index 35ce6cdd94cacd89314726dc065ff30a969b5a13..9932d5e63c53b9aa51cb0bbd1e8c3d89797220f8 100644 (file)
@@ -140,9 +140,9 @@ passwd_passwd_preinit(struct auth_userdb *auth_userdb, const char *args)
        struct passwd_userdb_module *module;
        const char *value;
 
-       module = p_new(auth_userdb->auth->pool, struct passwd_userdb_module, 1);
+       module = p_new(auth_userdb->pool, struct passwd_userdb_module, 1);
        module->module.cache_key = USER_CACHE_KEY;
-       module->tmpl = userdb_static_template_build(auth_userdb->auth->pool,
+       module->tmpl = userdb_static_template_build(auth_userdb->pool,
                                                    "passwd", args);
 
        if (userdb_static_template_remove(module->tmpl, "blocking",
index 7239c75ea130bfb66e7373b5a624b03ab9f9330a..d3b888c70613d88351ed91e73ac3569e525c5633 100644 (file)
@@ -230,11 +230,11 @@ userdb_sql_preinit(struct auth_userdb *auth_userdb, const char *args)
 {
        struct sql_userdb_module *module;
 
-       module = p_new(auth_userdb->auth->pool, struct sql_userdb_module, 1);
+       module = p_new(auth_userdb->pool, struct sql_userdb_module, 1);
        module->conn = db_sql_init(args);
 
        module->module.cache_key =
-               auth_cache_parse_key(auth_userdb->auth->pool,
+               auth_cache_parse_key(auth_userdb->pool,
                                     module->conn->set.user_query);
        return &module->module;
 }
index f1cc72b50a514f9b2f112e58e452498f976fb75f..d6fee5d191291a1e926deb44c9c7c0beb229b749 100644 (file)
@@ -217,8 +217,8 @@ static_preinit(struct auth_userdb *auth_userdb, const char *args)
        struct static_userdb_module *module;
        const char *value;
 
-       module = p_new(auth_userdb->auth->pool, struct static_userdb_module, 1);
-       module->tmpl = userdb_static_template_build(auth_userdb->auth->pool,
+       module = p_new(auth_userdb->pool, struct static_userdb_module, 1);
+       module->tmpl = userdb_static_template_build(auth_userdb->pool,
                                                    "static", args);
 
        if (userdb_static_template_remove(module->tmpl, "allow_all_users",
index 533c8645fd4aedea596f1d30bfc838cd12a42093..1e146825c64632fa754011b1c6e758e7d963dbdb 100644 (file)
@@ -141,7 +141,7 @@ vpopmail_preinit(struct auth_userdb *auth_userdb, const char *args)
 {
        struct vpopmail_userdb_module *module;
        const char *const *tmp, *p;
-       pool_t pool = auth_userdb->auth->pool;
+       pool_t pool = auth_userdb->pool;
 
        module = p_new(pool, struct vpopmail_userdb_module, 1);
 
index 7cfe2967fde5e20a4cf7ad13c0dc9fcbaa6bf179..13e44b22d48f5a5d448302b5aab8867080e7d556 100644 (file)
@@ -112,7 +112,7 @@ void userdb_preinit(struct auth *auth, struct auth_userdb_settings *set)
         struct auth_userdb *auth_userdb, **dest;
 
        auth_userdb = p_new(auth->pool, struct auth_userdb, 1);
-       auth_userdb->auth = auth;
+       auth_userdb->pool = auth->pool;
        auth_userdb->args = set->args == NULL ? "" :
                p_strdup(auth->pool, set->args);