dovecot-2.0: doveconf: Fixed a broken "subsection has ssl=yes" w...

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 20 18:55:40 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/7d60cd847c70
changeset: 12750:7d60cd847c70
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 20 18:55:17 2011 +0300
description:
doveconf: Fixed a broken "subsection has ssl=yes" warning.

diffstat:

 src/config/config-parser.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (62 lines):

diff -r 0e406e7cb609 -r 7d60cd847c70 src/config/config-parser.c
--- a/src/config/config-parser.c	Wed Apr 20 18:28:49 2011 +0300
+++ b/src/config/config-parser.c	Wed Apr 20 18:55:17 2011 +0300
@@ -335,7 +335,8 @@
 }
 
 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;
@@ -345,12 +346,13 @@
 	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
@@ -362,8 +364,7 @@
 	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;
@@ -381,8 +382,7 @@
 	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,
@@ -392,9 +392,9 @@
 			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;


More information about the dovecot-cvs mailing list