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

Dave Reisner dreisner at archlinux.org
Sat Mar 17 02:01:25 UTC 2012


    Date: Friday, March 16, 2012 @ 22:01:24
  Author: dreisner
Revision: 153638

upgpkg: systemd 44-1

Added:
  systemd/trunk/0001-util-never-follow-symlinks-in-rm_rf_children.patch
Modified:
  systemd/trunk/PKGBUILD

---------------------------------------------------------+
 0001-util-never-follow-symlinks-in-rm_rf_children.patch |   32 ++++++++++++++
 PKGBUILD                                                |   18 +++----
 2 files changed, 41 insertions(+), 9 deletions(-)

Added: 0001-util-never-follow-symlinks-in-rm_rf_children.patch
===================================================================
--- 0001-util-never-follow-symlinks-in-rm_rf_children.patch	                        (rev 0)
+++ 0001-util-never-follow-symlinks-in-rm_rf_children.patch	2012-03-17 02:01:24 UTC (rev 153638)
@@ -0,0 +1,32 @@
+From 5ebff5337594d690b322078c512eb222d34aaa82 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Fri, 2 Mar 2012 10:39:10 +0100
+Subject: [PATCH] util: never follow symlinks in rm_rf_children()
+
+The function checks if the entry is a directory before recursing, but
+there is a window between the check and the open, during which the
+directory could be replaced with a symlink.
+
+CVE-2012-1174
+https://bugzilla.redhat.com/show_bug.cgi?id=803358
+---
+ src/util.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/util.c b/src/util.c
+index 20cbc2b..dfc1dc6 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -3593,7 +3593,8 @@ static int rm_rf_children(int fd, bool only_dirs, bool honour_sticky) {
+                 if (is_dir) {
+                         int subdir_fd;
+ 
+-                        if ((subdir_fd = openat(fd, de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC)) < 0) {
++                        subdir_fd = openat(fd, de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
++                        if (subdir_fd < 0) {
+                                 if (ret == 0 && errno != ENOENT)
+                                         ret = -errno;
+                                 continue;
+-- 
+1.7.9.4
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-03-16 22:34:40 UTC (rev 153637)
+++ PKGBUILD	2012-03-17 02:01:24 UTC (rev 153638)
@@ -3,8 +3,8 @@
 
 pkgbase=systemd
 pkgname=('systemd' 'libsystemd')
-pkgver=43
-pkgrel=4
+pkgver=44
+pkgrel=1
 arch=('i686' 'x86_64')
 url="http://www.freedesktop.org/wiki/Software/systemd"
 license=('GPL2')
@@ -12,18 +12,18 @@
              'kmod' 'libcap' 'libxslt' 'linux-api-headers' 'pam' 'udev' 'xz')
 options=('!libtool')
 source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
-        "os-release" "cpp-compat.patch")
-md5sums=('446cc6db7625617af67e2d8e5f503a49'
+        "os-release"
+        0001-util-never-follow-symlinks-in-rm_rf_children.patch)
+md5sums=('11f44ff74c87850064e4351518bcff17'
          '752636def0db3c03f121f8b4f44a63cd'
-         '414968aa314ced0b0ab4b2207e46aa69')
+         'b5863d6d4b47e2b5bda8eb57bde0d327')
 
 build() {
   cd "$pkgname-$pkgver"
-  
-  # Fix C++ compile error when including sd-login.h
-  # http://comments.gmane.org/gmane.comp.sysutils.systemd.devel/4514
-  patch -p1 -i ../cpp-compat.patch
 
+  # https://bugzilla.redhat.com/show_bug.cgi?id=803358
+  patch -Np1 <"$srcdir/0001-util-never-follow-symlinks-in-rm_rf_children.patch"
+
   ./configure --sysconfdir=/etc \
               --libexecdir=/usr/lib \
               --libdir=/usr/lib \




More information about the arch-commits mailing list