From: Marco Bettini Date: Fri, 17 Jun 2022 15:03:13 +0000 (+0000) Subject: global: Rename auth_default_realm into auth_default_domain X-Git-Tag: 2.4.0~3943 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6bedccdb008e96c67e8cc1924a29a0103d6ef9a2;p=thirdparty%2Fdovecot%2Fcore.git global: Rename auth_default_realm into auth_default_domain --- diff --git a/doc/example-config/conf.d/10-auth.conf b/doc/example-config/conf.d/10-auth.conf index ce56ff41aa..ccf034ce80 100644 --- a/doc/example-config/conf.d/10-auth.conf +++ b/doc/example-config/conf.d/10-auth.conf @@ -30,7 +30,7 @@ # Default realm/domain to use if none was specified. This is used for both # SASL realms and appending @domain to username in plaintext logins. -#auth_default_realm = +#auth_default_domain = # List of allowed characters in username. If the user-given username contains # a character not listed in here, the login automatically fails. This is just diff --git a/src/auth/auth-request-fields.c b/src/auth/auth-request-fields.c index 9335e90f08..6f94b81765 100644 --- a/src/auth/auth-request-fields.c +++ b/src/auth/auth-request-fields.c @@ -293,10 +293,10 @@ auth_request_fix_username(struct auth_request *request, const char **username, unsigned char *p; char *user; - if (*set->default_realm != '\0' && + if (*set->default_domain != '\0' && strchr(*username, '@') == NULL) { user = p_strconcat(unsafe_data_stack_pool, *username, "@", - set->default_realm, NULL); + set->default_domain, NULL); } else { user = t_strdup_noconst(*username); } diff --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c index a3ba8b6385..a9ea4bd04d 100644 --- a/src/auth/auth-settings.c +++ b/src/auth/auth-settings.c @@ -228,7 +228,7 @@ const struct setting_parser_info auth_userdb_setting_parser_info = { static const struct setting_define auth_setting_defines[] = { DEF(STR, mechanisms), DEF(STR, realms), - DEF(STR, default_realm), + DEF(STR, default_domain), DEF(SIZE, cache_size), DEF(TIME, cache_ttl), DEF(TIME, cache_negative_ttl), @@ -285,7 +285,7 @@ static const struct setting_define auth_setting_defines[] = { static const struct auth_settings auth_default_settings = { .mechanisms = "plain", .realms = "", - .default_realm = "", + .default_domain = "", .cache_size = 0, .cache_ttl = 60*60, .cache_negative_ttl = 60*60, diff --git a/src/auth/auth-settings.h b/src/auth/auth-settings.h index fc4ec7008e..08d696e2b9 100644 --- a/src/auth/auth-settings.h +++ b/src/auth/auth-settings.h @@ -40,7 +40,7 @@ struct auth_userdb_settings { struct auth_settings { const char *mechanisms; const char *realms; - const char *default_realm; + const char *default_domain; uoff_t cache_size; unsigned int cache_ttl; unsigned int cache_negative_ttl; diff --git a/src/auth/test-lua.c b/src/auth/test-lua.c index c35848940e..6360de9e81 100644 --- a/src/auth/test-lua.c +++ b/src/auth/test-lua.c @@ -10,7 +10,7 @@ static struct auth_settings test_lua_auth_set = { .master_user_separator = "", - .default_realm = "", + .default_domain = "", .username_format = "", }; diff --git a/src/config/old-set-parser.c b/src/config/old-set-parser.c index cd584403c6..81258f24d2 100644 --- a/src/config/old-set-parser.c +++ b/src/config/old-set-parser.c @@ -245,6 +245,10 @@ old_settings_handle_root(struct config_parser_context *ctx, set_rename(ctx, key, new_key, value); return TRUE; } + if (strcmp(key, "auth_default_realm") == 0) { + set_rename(ctx, key, "auth_default_domain", value); + return TRUE; + } if (strcmp(key, "imap_client_workarounds") == 0) { char **args, **arg;