[dovecot-cvs] dovecot/src/deliver deliver.c,1.45,1.46
tss at dovecot.org
tss at dovecot.org
Mon Jan 22 10:57:15 UTC 2007
Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv30059
Modified Files:
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.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- deliver.c 21 Jan 2007 15:50:13 -0000 1.45
+++ deliver.c 22 Jan 2007 10:57:13 -0000 1.46
@@ -13,6 +13,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"
@@ -20,6 +21,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>
@@ -246,6 +249,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;
@@ -373,8 +383,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