dovecot-1.1: If some setting contains a bad value, make sure the...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jan 27 02:17:42 EET 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/6a69dbe4354b
changeset: 8133:6a69dbe4354b
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jan 26 19:17:33 2009 -0500
description:
If some setting contains a bad value, make sure the error message contains the setting name.

diffstat:

1 file changed, 16 insertions(+), 13 deletions(-)
src/master/master-settings.c |   29 ++++++++++++++++-------------

diffs (108 lines):

diff -r f9b8b02b185d -r 6a69dbe4354b src/master/master-settings.c
--- a/src/master/master-settings.c	Mon Jan 26 14:11:44 2009 -0500
+++ b/src/master/master-settings.c	Mon Jan 26 19:17:33 2009 -0500
@@ -455,7 +455,7 @@ static bool auth_settings_verify(struct 
 	auth->gid = pw->pw_gid;
 
 	if (access(t_strcut(auth->executable, ' '), X_OK) < 0) {
-		i_error("Can't use auth executable %s: %m",
+		i_error("auth_executable: Can't use %s: %m",
 			t_strcut(auth->executable, ' '));
 		return FALSE;
 	}
@@ -772,7 +772,7 @@ static bool settings_verify(struct setti
 
 	if (set->protocol != MAIL_PROTOCOL_ANY &&
 	    access(t_strcut(set->mail_executable, ' '), X_OK) < 0) {
-		i_error("Can't use mail executable %s: %m",
+		i_error("mail_executable: Can't use %s: %m",
 			t_strcut(set->mail_executable, ' '));
 		return FALSE;
 	}
@@ -780,7 +780,8 @@ static bool settings_verify(struct setti
 	if (*set->log_path != '\0' && access(set->log_path, W_OK) < 0) {
 		dir = get_directory(set->log_path);
 		if (access(dir, W_OK) < 0) {
-			i_error("Can't write to log directory %s: %m", dir);
+			i_error("log_path: Can't write to directory %s: %m",
+				dir);
 			return FALSE;
 		}
 	}
@@ -789,14 +790,15 @@ static bool settings_verify(struct setti
 	    access(set->info_log_path, W_OK) < 0) {
 		dir = get_directory(set->info_log_path);
 		if (access(dir, W_OK) < 0) {
-			i_error("Can't write to info log directory %s: %m",
+			i_error("info_log_path: Can't write to directory %s: %m",
 				dir);
 			return FALSE;
 		}
 	}
 
 	if (!syslog_facility_find(set->syslog_facility, &facility)) {
-		i_error("Unknown syslog_facility '%s'", set->syslog_facility);
+		i_error("syslog_facility: Unknown value: %s",
+			set->syslog_facility);
 		return FALSE;
 	}
 
@@ -804,18 +806,18 @@ static bool settings_verify(struct setti
 	if (!set->ssl_disable) {
 		if (*set->ssl_ca_file != '\0' &&
 		    access(set->ssl_ca_file, R_OK) < 0) {
-			i_fatal("Can't use SSL CA file %s: %m",
+			i_fatal("ssl_ca_file: Can't use %s: %m",
 				set->ssl_ca_file);
 		}
 
 		if (access(set->ssl_cert_file, R_OK) < 0) {
-			i_error("Can't use SSL certificate %s: %m",
+			i_error("ssl_cert_file: Can't use %s: %m",
 				set->ssl_cert_file);
 			return FALSE;
 		}
 
 		if (access(set->ssl_key_file, R_OK) < 0) {
-			i_error("Can't use SSL key file %s: %m",
+			i_error("ssl_key_file: Can't use %s: %m",
 				set->ssl_key_file);
 			return FALSE;
 		}
@@ -858,7 +860,7 @@ static bool settings_verify(struct setti
 
 	if (set->protocol != MAIL_PROTOCOL_ANY &&
 	    access(t_strcut(set->login_executable, ' '), X_OK) < 0) {
-		i_error("Can't use login executable %s: %m",
+		i_error("login_executable: Can't use %s: %m",
 			t_strcut(set->login_executable, ' '));
 		return FALSE;
 	}
@@ -884,14 +886,14 @@ static bool settings_verify(struct setti
 #ifdef HAVE_MODULES
 	if (*set->mail_plugins != '\0' &&
 	    access(set->mail_plugin_dir, R_OK | X_OK) < 0) {
-		i_error("Can't access mail module directory: %s: %m",
+		i_error("mail_plugin_dir: Can't access directory: %s: %m",
 			set->mail_plugin_dir);
 		return FALSE;
 	}
 #else
 	if (*set->mail_plugins != '\0') {
-		i_error("Module support wasn't built into Dovecot, "
-			"can't load modules: %s", set->mail_plugins);
+		i_error("mail_plugins: Plugin support wasn't built into Dovecot, "
+			"can't load plugins: %s", set->mail_plugins);
 		return FALSE;
 	}
 #endif
@@ -1526,7 +1528,8 @@ bool master_settings_read(const char *pa
 	for (server = ctx.root; server != NULL; server = server->next) {
 		if ((*server->imap->protocols == '\0' ||
 		     *server->pop3->protocols == '\0') && !nochecks) {
-			i_error("No protocols given in configuration file");
+			i_error("protocols: No protocols given "
+				"in configuration file");
 			return FALSE;
 		}
 		/* --exec-mail is used if nochecks=TRUE. Allow it regardless


More information about the dovecot-cvs mailing list