static const struct setting_define auth_userdb_setting_defines[] = {
DEF(STR, name),
DEF(STR, driver),
- DEF(STR_NOVARS, args),
DEF(BOOL, fields_import_all),
DEF(ENUM, skip),
/* NOTE: when adding fields, update also auth.c:userdb_dummy_set */
.name = "",
.driver = "",
- .args = "",
.fields_import_all = TRUE,
.skip = "never:found:notfound",
i_fatal("Support not compiled in for userdb driver '%s'",
set->driver);
}
- if (iface->preinit_legacy == NULL && iface->init == NULL &&
- *set->args != '\0') {
- i_fatal("userdb %s: No args are supported: %s",
- set->driver, set->args);
- }
if (iface->preinit != NULL) {
- if (set->args[0] != '\0')
- i_fatal("userdb %s: userdb_args must be empty", set->name);
if (iface->preinit(pool, event, &userdb, &error) < 0)
i_fatal("userdb %s: %s", set->name, error);
userdb->blocking = set->use_worker;
} else {
- if (iface->preinit_legacy == NULL)
- userdb = p_new(pool, struct userdb_module, 1);
- else
- userdb = iface->preinit_legacy(pool, set->args);
+ userdb = p_new(pool, struct userdb_module, 1);
}
userdb->id = ++auth_userdb_id;
userdb->iface = iface;
- userdb->args = p_strdup(pool, set->args);
array_push_back(&userdb_modules, &userdb);
return userdb;
}
typedef void userdb_iter_callback_t(const char *user, void *context);
struct userdb_module {
- const char *args;
/* The default caching key for this module, or NULL if caching isn't
wanted. This is updated by settings in auth_userdb. */
const char *default_cache_key;
given event. */
int (*preinit)(pool_t pool, struct event *event,
struct userdb_module **module_r, const char **error_r);
- struct userdb_module *(*preinit_legacy)(pool_t pool, const char *args);
void (*init)(struct userdb_module *module);
void (*deinit)(struct userdb_module *module);