[dovecot-cvs] dovecot/src/deliver deliver.c,1.20.2.24,1.20.2.25

tss at dovecot.org tss at dovecot.org
Mon Jan 22 10:57:13 UTC 2007


Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv30057

Modified Files:
      Tag: branch_1_0
	deliver.c 
Log Message:
If config file contained quoted "value", the quotes weren't stripped.
syslog_facility wasn't converted from name to numeric value.



Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/deliver.c,v
retrieving revision 1.20.2.24
retrieving revision 1.20.2.25
diff -u -d -r1.20.2.24 -r1.20.2.25
--- deliver.c	21 Jan 2007 15:49:52 -0000	1.20.2.24
+++ deliver.c	22 Jan 2007 10:57:11 -0000	1.20.2.25
@@ -12,6 +12,7 @@
 #include "module-dir.h"
 #include "str.h"
 #include "str-sanitize.h"
+#include "strescape.h"
 #include "var-expand.h"
 #include "message-address.h"
 #include "dict-client.h"
@@ -19,6 +20,8 @@
 #include "auth-client.h"
 #include "mail-send.h"
 #include "duplicate.h"
+#include "../master/syslog-util.h"
+#include "../master/syslog-util.c" /* ugly, ugly.. */
 #include "deliver.h"
 
 #include <stdio.h>
@@ -248,6 +251,13 @@
 			value++;
 		} while (*value == ' ');
 
+		len = strlen(value);
+		if (len > 0 &&
+		    ((*value == '"' && value[len-1] == '"') ||
+		     (*value == '\'' && value[len-1] == '\''))) {
+			value = str_unescape(p_strndup(unsafe_data_stack_pool,
+						       value+1, len - 2));
+		}
 		if (setting_is_bool(key) && strcasecmp(value, "yes") != 0)
 			continue;
 
@@ -375,8 +385,11 @@
 	log_path = getenv("LOG_PATH");
 	if (log_path == NULL || *log_path == '\0') {
 		const char *env = getenv("SYSLOG_FACILITY");
-		i_set_failure_syslog(prefix, LOG_NDELAY,
-				     env == NULL ? LOG_MAIL : atoi(env));
+		int facility;
+
+		if (env == NULL || !syslog_facility_find(env, &facility))
+			facility = LOG_MAIL;
+		i_set_failure_syslog(prefix, LOG_NDELAY, facility);
 	} else {
 		/* log to file or stderr */
 		i_set_failure_file(log_path, prefix);



More information about the dovecot-cvs mailing list