From: Timo Sirainen Date: Mon, 3 Apr 2023 11:26:21 +0000 (+0300) Subject: config: old-set-parser - Move login_access_sockets handling to removed_settings[] X-Git-Tag: 2.4.0~2246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1cbff114b1a4967c3808d1234f7e5c56b663c8b;p=thirdparty%2Fdovecot%2Fcore.git config: old-set-parser - Move login_access_sockets handling to removed_settings[] --- diff --git a/src/config/old-set-parser.c b/src/config/old-set-parser.c index cf23236d0c..3afb0b88ef 100644 --- a/src/config/old-set-parser.c +++ b/src/config/old-set-parser.c @@ -47,6 +47,7 @@ static const struct config_filter managesieve_filter = { static const struct { const char *key; + bool fail_if_set; } removed_settings[] = { { .key = "login_dir", }, { .key = "license_checksum", }, @@ -57,6 +58,7 @@ static const struct { { .key = "maildir_copy_preserve_filename", }, { .key = "ssl_parameters_regenerate", }, { .key = "ssl_dh_parameters_length", }, + { .key = "login_access_sockets", .fail_if_set = TRUE, }, }; static void ATTR_FORMAT(2, 3) @@ -285,6 +287,9 @@ old_settings_handle_root(struct config_parser_context *ctx, for (unsigned int i = 0; i < N_ELEMENTS(removed_settings); i++) { if (strcmp(removed_settings[i].key, key) == 0) { + if (removed_settings[i].fail_if_set && + value != NULL && *value != '\0') + i_fatal("%s is no longer supported", key); obsolete(ctx, "%s has been removed", key); return TRUE; } @@ -313,13 +318,6 @@ old_settings_handle_root(struct config_parser_context *ctx, ctx->old->post_log_debug = p_strdup(ctx->pool, value); return FALSE; } - if (strcmp(key, "login_access_sockets") == 0) { - if (value != NULL && *value != '\0') - i_fatal("%s is no longer supported", key); - else - obsolete(ctx, "%s is no longer supported", key); - return TRUE; - } if (strcmp(key, "disable_plaintext_auth") == 0) { const char *error; bool b;