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

Dave Reisner dreisner at archlinux.org
Sun Jan 13 16:06:22 UTC 2013


    Date: Sunday, January 13, 2013 @ 11:06:21
  Author: dreisner
Revision: 175101

upgpkg: systemd 197-4

- backport fix for crash in usage of calendar timers.
  NB: this isn't a full fix for the serialization problem,
  but the second patch is large and scary.

Added:
  systemd/trunk/0001-dbus-fix-serialization-of-calendar-timers.patch
Modified:
  systemd/trunk/PKGBUILD

------------------------------------------------------+
 0001-dbus-fix-serialization-of-calendar-timers.patch |   62 +++++++++++++++++
 PKGBUILD                                             |    8 +-
 2 files changed, 69 insertions(+), 1 deletion(-)

Added: 0001-dbus-fix-serialization-of-calendar-timers.patch
===================================================================
--- 0001-dbus-fix-serialization-of-calendar-timers.patch	                        (rev 0)
+++ 0001-dbus-fix-serialization-of-calendar-timers.patch	2013-01-13 16:06:21 UTC (rev 175101)
@@ -0,0 +1,62 @@
+From 3761902e2e120849c283106fd4b78b6adec7367e Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 8 Jan 2013 20:00:01 +0100
+Subject: [PATCH] dbus: fix serialization of calendar timers
+
+---
+ src/core/dbus-timer.c | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
+index 11d18cb..b22fcb5 100644
+--- a/src/core/dbus-timer.c
++++ b/src/core/dbus-timer.c
+@@ -69,22 +69,28 @@ static int bus_timer_append_timers(DBusMessageIter *i, const char *property, voi
+                 return -ENOMEM;
+ 
+         LIST_FOREACH(value, k, p->values) {
+-                char *buf;
++                _cleanup_free_ char *buf = NULL;
+                 const char *t;
+                 size_t l;
+                 bool b;
+ 
+                 t = timer_base_to_string(k->base);
+-                assert(endswith(t, "Sec"));
+ 
+-                /* s/Sec/USec/ */
+-                l = strlen(t);
+-                buf = new(char, l+2);
+-                if (!buf)
+-                        return -ENOMEM;
++                if (endswith(t, "Sec")) {
++
++                        /* s/Sec/USec/ */
++                        l = strlen(t);
++                        buf = new(char, l+2);
++                        if (!buf)
++                                return -ENOMEM;
+ 
+-                memcpy(buf, t, l-3);
+-                memcpy(buf+l-3, "USec", 5);
++                        memcpy(buf, t, l-3);
++                        memcpy(buf+l-3, "USec", 5);
++                } else {
++                        buf = strdup(t);
++                        if (!buf)
++                                return -ENOMEM;
++                }
+ 
+                 b = dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2) &&
+                         dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &buf) &&
+@@ -92,7 +98,6 @@ static int bus_timer_append_timers(DBusMessageIter *i, const char *property, voi
+                         dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT64, &k->next_elapse) &&
+                         dbus_message_iter_close_container(&sub, &sub2);
+ 
+-                free(buf);
+                 if (!b)
+                         return -ENOMEM;
+         }
+-- 
+1.8.1
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-01-13 15:06:57 UTC (rev 175100)
+++ PKGBUILD	2013-01-13 16:06:21 UTC (rev 175101)
@@ -4,7 +4,7 @@
 pkgbase=systemd
 pkgname=('systemd' 'systemd-sysvcompat')
 pkgver=197
-pkgrel=3
+pkgrel=4
 arch=('i686' 'x86_64')
 url="http://www.freedesktop.org/wiki/Software/systemd"
 license=('GPL2' 'LGPL2.1' 'MIT')
@@ -13,11 +13,13 @@
              'linux-api-headers' 'pam' 'python' 'quota-tools' 'xz')
 options=('!libtool')
 source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
+        '0001-dbus-fix-serialization-of-calendar-timers.patch'
         'initcpio-hook-udev'
         'initcpio-install-udev'
         'initcpio-install-timestamp'
         'use-split-usr-path.patch')
 md5sums=('56a860dceadfafe59f40141eb5223743'
+         '0341d680d5ab16bab3978bac96bf8797'
          'e99e9189aa2f6084ac28b8ddf605aeb8'
          'fb37e34ea006c79be1c54cbb0f803414'
          'df69615503ad293c9ddf9d8b7755282d'
@@ -29,6 +31,10 @@
   # hang onto this until we do the /{,s}bin merge
   patch -Np1 <"$srcdir/use-split-usr-path.patch"
 
+  # fix assertion failure when using calendar timers
+  # upstream 3761902e2e120849c283106fd4b78b6adec7367e
+  patch -Np1 <"$srcdir/0001-dbus-fix-serialization-of-calendar-timers.patch"
+
   ./configure \
       PYTHON=python2 \
       PYTHON_CONFIG=python2-config \




More information about the arch-commits mailing list