auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter 7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904 Index: src/auth/auth.c --- src/auth/auth.c.orig +++ src/auth/auth.c @@ -93,6 +93,24 @@ auth_passdb_preinit(struct auth *auth, const struct au auth_passdb->override_fields_tmpl = passdb_template_build(auth->pool, set->override_fields); + if (*set->mechanisms == '\0') { + auth_passdb->mechanisms = NULL; + } else if (strcasecmp(set->mechanisms, "none") == 0) { + auth_passdb->mechanisms = (const char *const[]){ NULL }; + } else { + auth_passdb->mechanisms = + (const char *const *)p_strsplit_spaces(auth->pool, + set->mechanisms, " ,"); + } + + if (*set->username_filter == '\0') { + auth_passdb->username_filter = NULL; + } else { + auth_passdb->username_filter = + (const char *const *)p_strsplit_spaces(auth->pool, + set->username_filter, " ,"); + } + /* for backwards compatibility: */ if (set->pass) auth_passdb->result_success = AUTH_DB_RULE_CONTINUE;