[arch-commits] Commit in systemd/trunk (2 files)

Dave Reisner dreisner at nymeria.archlinux.org
Mon Sep 9 14:10:41 UTC 2013


    Date: Monday, September 9, 2013 @ 16:10:41
  Author: dreisner
Revision: 193987

upgpkg: systemd 206-3

- backport fix to correct syslog facility parsing (FS#36837)

Added:
  systemd/trunk/0001-journal-fix-parsing-of-facility-in-syslog-messages.patch
Modified:
  systemd/trunk/PKGBUILD

---------------------------------------------------------------+
 0001-journal-fix-parsing-of-facility-in-syslog-messages.patch |   89 ++++++++++
 PKGBUILD                                                      |    9 -
 2 files changed, 95 insertions(+), 3 deletions(-)

Added: 0001-journal-fix-parsing-of-facility-in-syslog-messages.patch
===================================================================
--- 0001-journal-fix-parsing-of-facility-in-syslog-messages.patch	                        (rev 0)
+++ 0001-journal-fix-parsing-of-facility-in-syslog-messages.patch	2013-09-09 14:10:41 UTC (rev 193987)
@@ -0,0 +1,89 @@
+From ac50788b0f5aeee09e7d45db28ae8ab7f39cd52e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Fri, 26 Jul 2013 12:57:33 -0400
+Subject: [PATCH] journal: fix parsing of facility in syslog messages
+
+In 49998b383 (journald: do not overwrite syslog facility when
+parsing priority) journald started ignoring facility part when
+reading service stderr to convert to syslog messages. In this
+case it is fine, because only the priority is allowed.
+
+But the same codepath is used for syslog messages, where the
+facility should be used. Split the two codepaths by explicitly
+specyfing whether the facility should be ignored or not.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=988814
+---
+ src/journal/journald-stream.c |  2 +-
+ src/journal/journald-syslog.c | 12 ++++++++----
+ src/journal/journald-syslog.h |  2 +-
+ 3 files changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
+index e98fe94..9c4efec 100644
+--- a/src/journal/journald-stream.c
++++ b/src/journal/journald-stream.c
+@@ -90,7 +90,7 @@ static int stdout_stream_log(StdoutStream *s, const char *p) {
+         priority = s->priority;
+ 
+         if (s->level_prefix)
+-                syslog_parse_priority((char**) &p, &priority);
++                syslog_parse_priority((char**) &p, &priority, false);
+ 
+         if (s->forward_to_syslog || s->server->forward_to_syslog)
+                 server_forward_syslog(s->server, syslog_fixup_facility(priority), s->identifier, p, &s->ucred, NULL);
+diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
+index 7cbb346..c2770a5 100644
+--- a/src/journal/journald-syslog.c
++++ b/src/journal/journald-syslog.c
+@@ -236,7 +236,7 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid)
+         return e;
+ }
+ 
+-void syslog_parse_priority(char **p, int *priority) {
++void syslog_parse_priority(char **p, int *priority, bool with_facility) {
+         int a = 0, b = 0, c = 0;
+         int k;
+ 
+@@ -265,10 +265,14 @@ void syslog_parse_priority(char **p, int *priority) {
+         } else
+                 return;
+ 
+-        if (a < 0 || b < 0 || c < 0)
++        if (a < 0 || b < 0 || c < 0 ||
++            (!with_facility && (a || b || c > 7)))
+                 return;
+ 
+-        *priority = (*priority & LOG_FACMASK) | (a*100 + b*10 + c);
++        if (with_facility)
++                *priority = a*100 + b*10 + c;
++        else
++                *priority = (*priority & LOG_FACMASK) | c;
+         *p += k;
+ }
+ 
+@@ -361,7 +365,7 @@ void server_process_syslog_message(
+         assert(buf);
+ 
+         orig = buf;
+-        syslog_parse_priority((char**) &buf, &priority);
++        syslog_parse_priority((char**) &buf, &priority, true);
+ 
+         if (s->forward_to_syslog)
+                 forward_syslog_raw(s, priority, orig, ucred, tv);
+diff --git a/src/journal/journald-syslog.h b/src/journal/journald-syslog.h
+index 324b70e..8ccdb77 100644
+--- a/src/journal/journald-syslog.h
++++ b/src/journal/journald-syslog.h
+@@ -25,7 +25,7 @@
+ 
+ int syslog_fixup_facility(int priority) _const_;
+ 
+-void syslog_parse_priority(char **p, int *priority);
++void syslog_parse_priority(char **p, int *priority, bool with_facility);
+ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid);
+ 
+ void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, struct ucred *ucred, struct timeval *tv);
+-- 
+1.8.4
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-09-09 13:40:39 UTC (rev 193986)
+++ PKGBUILD	2013-09-09 14:10:41 UTC (rev 193987)
@@ -4,7 +4,7 @@
 pkgbase=systemd
 pkgname=('systemd' 'systemd-sysvcompat')
 pkgver=206
-pkgrel=2
+pkgrel=3
 arch=('i686' 'x86_64')
 url="http://www.freedesktop.org/wiki/Software/systemd"
 makedepends=('acl' 'cryptsetup' 'dbus-core' 'docbook-xsl' 'gobject-introspection' 'gperf'
@@ -18,7 +18,8 @@
         0001-udev-static_node-don-t-touch-permissions-uneccessari.patch
         0002-tmpfiles-support-passing-prefix-multiple-times.patch
         0003-tmpfiles-introduce-exclude-prefix.patch
-        0004-tmpfiles-setup-exclude-dev-prefixes-files.patch)
+        0004-tmpfiles-setup-exclude-dev-prefixes-files.patch
+        0001-journal-fix-parsing-of-facility-in-syslog-messages.patch)
 md5sums=('89e36f2d3ba963020b72738549954cbc'
          '2de72238ed5c0df62a7c3b6bdaf8cb7c'
          '9027b31a875e74a45623954b3b23d09f'
@@ -26,7 +27,8 @@
          '133232cf621ca6333beefa20173e520e'
          '948dd905195caafa7e528c3afa4a679a'
          '121ea2d14d19548f5e317c925e2e7482'
-         '81a65872b15d14d7ac8250e029ae0cbe')
+         '81a65872b15d14d7ac8250e029ae0cbe'
+         'c9565efc96a3f24effdf907049af6c44')
 
 prepare() {
   cd "$pkgname-$pkgver"
@@ -35,6 +37,7 @@
   patch -Np1 <"$srcdir"/0002-tmpfiles-support-passing-prefix-multiple-times.patch
   patch -Np1 <"$srcdir"/0003-tmpfiles-introduce-exclude-prefix.patch
   patch -Np1 <"$srcdir"/0004-tmpfiles-setup-exclude-dev-prefixes-files.patch
+  patch -Np1 <"$srcdir"/0001-journal-fix-parsing-of-facility-in-syslog-messages.patch
 }
 
 build() {




More information about the arch-commits mailing list