[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, master, updated. debian/0.8.8-2-2-g7302aff

Guido Günther agx at sigxcpu.org
Wed Mar 9 14:46:28 UTC 2011


The following commit has been merged in the master branch:
commit 7302affb520bf39a0e58e9a7f2e70b521ca22b5c
Author: Guido Günther <agx at sigxcpu.org>
Date:   Wed Mar 9 15:45:39 2011 +0100

    New patch Make-sure-the-rundir-is-accessible-by-the-user.patch
    
    Make sure the rundir is accessible by the user
    
    Closes: #614210

diff --git a/debian/patches/Make-sure-the-rundir-is-accessible-by-the-user.patch b/debian/patches/Make-sure-the-rundir-is-accessible-by-the-user.patch
new file mode 100644
index 0000000..dc30167
--- /dev/null
+++ b/debian/patches/Make-sure-the-rundir-is-accessible-by-the-user.patch
@@ -0,0 +1,38 @@
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Wed, 9 Mar 2011 14:15:48 +0100
+Subject: Make sure the rundir is accessible by the user
+
+otherwise the user might not have enough permissions to access the
+socket if root's umask is 077.
+
+http://bugs.debian.org/614210
+---
+ daemon/libvirtd.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
+index f4b3327..7ce75f4 100644
+--- a/daemon/libvirtd.c
++++ b/daemon/libvirtd.c
+@@ -3225,16 +3225,20 @@ int main(int argc, char **argv) {
+     /* Ensure the rundir exists (on tmpfs on some systems) */
+     if (geteuid() == 0) {
+         const char *rundir = LOCALSTATEDIR "/run/libvirt";
++        mode_t old_umask;
+ 
++        old_umask = umask(022);
+         if (mkdir (rundir, 0755)) {
+             if (errno != EEXIST) {
+                 char ebuf[1024];
+                 VIR_ERROR(_("unable to create rundir %s: %s"), rundir,
+                           virStrerror(errno, ebuf, sizeof(ebuf)));
+                 ret = VIR_DAEMON_ERR_RUNDIR;
++                umask(old_umask);
+                 goto error;
+             }
+         }
++        umask(old_umask);
+     }
+ 
+     /* Beyond this point, nothing should rely on using
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 2c8db5c..a54d51c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ Disable-CHECKSUM-rule.patch
 Debianize-libvirt-guests.patch
 Don-t-pass-empty-arguments-to-dnsmasq.patch
 Do-not-add-drive-boot-on-param-when-a-kernel-is-spec.patch
+Make-sure-the-rundir-is-accessible-by-the-user.patch

-- 
Libvirt Debian packaging



More information about the Pkg-libvirt-commits mailing list