]> git.proxmox.com Git - systemd.git/commitdiff
sd-device: fix device_get_properties_strv()
authorMartin Pitt <martin.pitt@ubuntu.com>
Sun, 31 May 2015 18:48:42 +0000 (20:48 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Sun, 31 May 2015 18:48:42 +0000 (20:48 +0200)
Fixes environment for processes spawned by udev, in particular "allow-hoplug"
ifupdown interfaces via ifup@.service.

Patch cherry-picked from upstream trunk.

Closes: #787263
debian/changelog
debian/patches/sd-device-fix-device_get_properties_strv.patch [new file with mode: 0644]
debian/patches/series

index 4bf93dd62a4e34cfe35fff4d2c14986639a356ea..414da159ce1c89d1b1c4559645d098715966a437 100644 (file)
@@ -2,6 +2,9 @@ systemd (220-3) UNRELEASED; urgency=medium
 
   * Fix ProtectSystem=yes to actually protect /usr, not /home.
     (Closes: #787343)
+  * sd-device: fix device_get_properties_strv(). Fixes environment for
+    processes spawned by udev, in particular "allow-hoplug" ifupdown
+    interfaces via ifup@.service. (Closes: #787263)
 
  -- Martin Pitt <mpitt@debian.org>  Sun, 31 May 2015 20:33:36 +0200
 
diff --git a/debian/patches/sd-device-fix-device_get_properties_strv.patch b/debian/patches/sd-device-fix-device_get_properties_strv.patch
new file mode 100644 (file)
index 0000000..8dd48ae
--- /dev/null
@@ -0,0 +1,30 @@
+From: Tom Gundersen <teg@jklm.no>
+Date: Wed, 27 May 2015 23:26:39 +0200
+Subject: sd-device: fix device_get_properties_strv()
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+A NULL pointer was inserted as the first element of the strv.
+
+This had the effect of always passing the empty environment to processes
+spawned by udev.
+
+Reported by MichaƂ Bartoszkiewicz.
+---
+ src/libsystemd/sd-device/device-private.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c
+index 3cadedb..10370af 100644
+--- a/src/libsystemd/sd-device/device-private.c
++++ b/src/libsystemd/sd-device/device-private.c
+@@ -659,7 +659,7 @@ static int device_update_properties_bufs(sd_device *device) {
+                 if (!buf_strv)
+                         return -ENOMEM;
+-                buf_strv[++ strv_size] = (char *)&buf_nulstr[nulstr_len];
++                buf_strv[strv_size ++] = (char *)&buf_nulstr[nulstr_len];
+                 strscpyl((char *)buf_nulstr + nulstr_len, len + 1, prop, "=", val, NULL);
+                 nulstr_len += len + 1;
+         }
index 2c3d8880ddd9c72e044bb04bc1b8c6304d90214c..e9fd3e5ffd8c545971d34156dc4ab41ed2cc6026 100644 (file)
@@ -6,6 +6,7 @@ man-use-configured-path-for-mount-and-umount-binarie.patch
 systemctl-drop-hardcoded-chkconfig-invocation.patch
 systemctl-Don-t-skip-SysV-init.d-scripts-when-enabli.patch
 core-namespace-Protect-usr-instead-of-home-with-Prot.patch
+sd-device-fix-device_get_properties_strv.patch
 
 ## Debian specific patches
 Add-back-support-for-Debian-specific-config-files.patch