aboutsummaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-06-11 12:31:16 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-06-11 15:57:12 +0100
commit0ec82620921567d46a0b490e011d8b58bf080a0e (patch)
tree22e6b71a9f796f4b4a85c7ffb85548ba6234bdb8 /daemon
parentOnly migrate profile in non-privileged libvirtd instance (diff)
downloadlibvirt-0ec82620921567d46a0b490e011d8b58bf080a0e.tar.gz
libvirt-0ec82620921567d46a0b490e011d8b58bf080a0e.tar.bz2
libvirt-0ec82620921567d46a0b490e011d8b58bf080a0e.zip
Fix privileges on /var/run/libvirt directory
Previous commit commit 32a9aac2e04c991340b66c855a1095e4e6445e54 Author: William Jon McCann <william.jon.mccann@gmail.com> Date: Thu May 3 12:36:27 2012 -0400 Use XDG Base Directories instead of storing in home directory Accidentally changed the umask when creating /var/run/libvirt to 077. This prevents /var/run/libvirt being readable by non-root, which is required for non-root to connect to libvirtd. Fix the code so that umask 077 is only used for the non-privileged libvirtd instance.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/libvirtd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index de6c96eab..c1ee3f4ef 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1131,7 +1131,10 @@ int main(int argc, char **argv) {
goto cleanup;
}
- old_umask = umask(077);
+ if (privileged)
+ old_umask = umask(022);
+ else
+ old_umask = umask(077);
if (virFileMakePath(run_dir) < 0) {
char ebuf[1024];
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,