}
static const char *
-get_str_setting(struct config_filter_parser *parser, const char *key)
+get_str_setting(struct config_filter_parser *parser, const char *key,
+ const char *default_value)
{
struct config_module_parser *module_parser;
const char *const *set_value;
for (; module_parser->parser != NULL; module_parser++) {
set_value = settings_parse_get_value(module_parser->parser,
key, &set_type);
- if (set_value != NULL) {
+ if (set_value != NULL &&
+ settings_parse_is_changed(module_parser->parser, key)) {
i_assert(set_type == SET_STR || set_type == SET_ENUM);
return *set_value;
}
}
- i_unreached();
+ return default_value;
}
static int
struct config_module_parser *tmp_parsers;
struct master_service_settings_output output;
unsigned int i, count;
- const char *ssl_set;
- bool global_no_ssl;
+ const char *ssl_set, *global_ssl_set;
pool_t tmp_pool;
bool ssl_warned = FALSE;
int ret = 0;
i_assert(count > 0 && parsers[count-1] == NULL);
count--;
- global_no_ssl = strcmp(get_str_setting(parsers[0], "ssl"), "no") == 0;
-
+ global_ssl_set = get_str_setting(parsers[0], "ssl", "");
for (i = 0; i < count && ret == 0; i++) {
if (config_filter_parsers_get(new_filter, tmp_pool, "",
&parsers[i]->filter,
break;
}
- ssl_set = get_str_setting(parsers[i], "ssl");
- if (strcmp(ssl_set, "no") != 0 && global_no_ssl &&
- !ssl_warned) {
+ ssl_set = get_str_setting(parsers[i], "ssl", global_ssl_set);
+ if (strcmp(ssl_set, "no") != 0 &&
+ strcmp(global_ssl_set, "no") == 0 && !ssl_warned) {
i_warning("SSL is disabled because global ssl=no, "
"ignoring ssl=%s for subsection", ssl_set);
ssl_warned = TRUE;