]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: userdb.preinit() - Add userdb_parameters parameter
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 6 Nov 2025 12:46:39 +0000 (14:46 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 13 Nov 2025 22:50:48 +0000 (22:50 +0000)
src/auth/userdb-ldap.c
src/auth/userdb-lua.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.c
src/auth/userdb.h

index 21f127c11e2628ca39df49da581d0c97515c3c33..3f0d3824a08e651ea61c985d2279dace3410e12b 100644 (file)
@@ -312,9 +312,11 @@ static int userdb_ldap_iterate_deinit(struct userdb_iterate_context *_ctx)
        return ret;
 }
 
-static int userdb_ldap_preinit(pool_t pool, struct event *event,
-                              struct userdb_module **module_r,
-                              const char **error_r ATTR_UNUSED)
+static int
+userdb_ldap_preinit(pool_t pool, struct event *event,
+                   const struct userdb_parameters *userdb_params ATTR_UNUSED,
+                   struct userdb_module **module_r,
+                   const char **error_r ATTR_UNUSED)
 {
        const struct auth_userdb_post_settings *auth_post = NULL;
        const struct ldap_post_settings *ldap_post = NULL;
index b1e9de8b0d8a9f2eadb3f25428cd108647fd4459..329e3a64b0016e434fd0ba8f8e5c3fdc4b47f675 100644 (file)
@@ -31,6 +31,7 @@ static void userdb_lua_lookup(struct auth_request *auth_request,
 
 static int
 userdb_lua_preinit(pool_t pool, struct event *event,
+                  const struct userdb_parameters *userdb_params ATTR_UNUSED,
                   struct userdb_module **module_r, const char **error_r)
 {
        struct dlua_userdb_module *module;
index 35bc952a6b16efb084d3427715e3996c41f5d2cf..aa57c98dd7068b3e383ac5f5e4fd57e215f5589a 100644 (file)
@@ -233,6 +233,7 @@ static int passwd_file_iterate_deinit(struct userdb_iterate_context *_ctx)
 
 static int
 passwd_file_preinit(pool_t pool, struct event *event,
+                   const struct userdb_parameters *userdb_params ATTR_UNUSED,
                    struct userdb_module **module_r, const char **error_r)
 {
        struct passwd_file_userdb_module *module;
index 14cf90a6d65f65f70e439ede73b603b748045899..39f0f9770d27a4244058c969203405ce89ad33e9 100644 (file)
@@ -217,9 +217,11 @@ static int passwd_iterate_deinit(struct userdb_iterate_context *_ctx)
        return ret;
 }
 
-static int passwd_preinit(pool_t pool, struct event *event ATTR_UNUSED,
-                         struct userdb_module **module_r,
-                         const char **error_r ATTR_UNUSED)
+static int
+passwd_preinit(pool_t pool, struct event *event ATTR_UNUSED,
+              const struct userdb_parameters *userdb_params ATTR_UNUSED,
+              struct userdb_module **module_r,
+              const char **error_r ATTR_UNUSED)
 {
        struct passwd_userdb_module *module =
                p_new(pool, struct passwd_userdb_module, 1);
index f97fe5e316c632c1e467834be528903624da7e23..bbf5e0ddedc4abcea4dbddd3b10fbd9deb373b90 100644 (file)
@@ -292,6 +292,7 @@ static int userdb_sql_iterate_deinit(struct userdb_iterate_context *_ctx)
 
 static int
 userdb_sql_preinit(pool_t pool, struct event *event,
+                  const struct userdb_parameters *userdb_params ATTR_UNUSED,
                   struct userdb_module **module_r, const char **error_r)
 {
        struct sql_userdb_module *module;
index 3f19ca222a62d2bdade8bdb69d97f936b04931ea..19109972420193227fb46e9b3358ac2d8b64ddd3 100644 (file)
@@ -104,8 +104,10 @@ static void static_lookup(struct auth_request *auth_request,
        }
 }
 
-static int static_preinit(pool_t pool, struct event *event,
-                         struct userdb_module **module_r, const char **error_r)
+static int
+static_preinit(pool_t pool, struct event *event,
+              const struct userdb_parameters *userdb_params ATTR_UNUSED,
+              struct userdb_module **module_r, const char **error_r)
 
 {
        struct auth_static_settings *set;
index 1606c3211e7f6456eaa3e3d678137ea836db0ae4..09873d33c15d969dace96d1ce24abe3fd9614334 100644 (file)
@@ -121,7 +121,9 @@ userdb_preinit(pool_t pool, struct event *event,
        }
 
        if (iface->preinit != NULL) {
-               if (iface->preinit(pool, event, &userdb, &error) < 0)
+               struct userdb_parameters params;
+               i_zero(&params);
+               if (iface->preinit(pool, event, &params, &userdb, &error) < 0)
                        i_fatal("userdb %s: %s", set->name, error);
                userdb->blocking = set->use_worker;
        } else {
index 6fa52efe428b471e0568245692a3b21e4055e030..96410f4af21c4f4415713234e420b25d93c41ed7 100644 (file)
@@ -44,12 +44,16 @@ struct userdb_iterate_context {
        bool failed;
 };
 
+struct userdb_parameters {
+};
+
 struct userdb_module_interface {
        const char *name;
 
        /* Create a new userdb_module based on the settings looked up via the
           given event. */
        int (*preinit)(pool_t pool, struct event *event,
+                      const struct userdb_parameters *userdb_params,
                       struct userdb_module **module_r, const char **error_r);
        void (*init)(struct userdb_module *module);
        void (*deinit)(struct userdb_module *module);