summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c090ce)
raw | patch | inline | side by side (parent: 8c090ce)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 23 Nov 2014 13:41:45 +0000 (14:41 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 23 Nov 2014 13:41:45 +0000 (14:41 +0100) |
Upstream fix to correct logging behavior when using an invalid log level.
Thanks to Marc Fournier for reporting this.
Closes: #770694
Thanks to Marc Fournier for reporting this.
Closes: #770694
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/bts770694_loglevel.dpatch | [new file with mode: 0755] | patch | blob |
diff --git a/debian/changelog b/debian/changelog
index fcc68eb6fa95dc571a090815f453ff58fbadac61..5af677953280a0787cdbbd7e3945573f78fce93f 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
thanks to Marc Fournier for reporting this (Closes: #770690).
- Added bts770693_timestamps: upstream fix for handling internal
timestamps; thanks to Marc Fournier for reporting this (Closes: #770693)
+ - Added bts770694_loglevel: upstream fix to correct logging behavior when
+ using an invalid log level; thanks to Marc Fournier for reporting this
+ (Closes: #770694).
-- Sebastian Harl <tokkee@debian.org> Sun, 23 Nov 2014 13:04:03 +0100
diff --git a/debian/patches/00list b/debian/patches/00list
index 92316ee5157aa87bf8352773c909f7388ff893de..61ca4d3aecc1c2f2c1b96a132d0694a10ab1d31d 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
bts750440_config_segfault.dpatch
bts770688_snmp_memleak.dpatch
bts770690_java_jni_thread_detach.dpatch
+bts770694_loglevel.dpatch
diff --git a/debian/patches/bts770694_loglevel.dpatch b/debian/patches/bts770694_loglevel.dpatch
--- /dev/null
@@ -0,0 +1,45 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts770694_loglevel.dpatch
+##
+## DP: Make sure not to disable logging on invalid log levels.
+## DP:
+## DP: Debug logging is not compiled into the Debian packages. Make sure to
+## DP: fall back to INFO and report and error rather than silently dropping
+## DP: all further log messages.
+## DP:
+## DP: Upstream bug report:
+## DP: https://github.com/collectd/collectd/issues/636
+
+@DPATCH@
+
+diff a/src/logfile.c b/src/logfile.c
+--- a/src/logfile.c
++++ b/src/logfile.c
+@@ -54,7 +54,11 @@ static int logfile_config (const char *key, const char *value)
+ {
+ if (0 == strcasecmp (key, "LogLevel")) {
+ log_level = parse_log_severity(value);
+- if (log_level == -1) return 1; /* to keep previous behaviour */
++ if (log_level < 0) {
++ log_level = LOG_INFO;
++ ERROR ("logfile: invalid loglevel [%s] defaulting to 'info'", value);
++ return (1);
++ }
+ }
+ else if (0 == strcasecmp (key, "File")) {
+ sfree (log_file);
+diff a/src/syslog.c b/src/syslog.c
+--- a/src/syslog.c
++++ b/src/syslog.c
+@@ -48,7 +48,11 @@ static int sl_config (const char *key, const char *value)
+ {
+ log_level = parse_log_severity (value);
+ if (log_level < 0)
++ {
++ log_level = LOG_INFO;
++ ERROR ("syslog: invalid loglevel [%s] defaulting to 'info'", value);
+ return (1);
++ }
+ }
+ else if (strcasecmp (key, "NotifyLevel") == 0)
+ {