[libvirt] [patch]make rundir permission equals to socket permission to support unprivileged access

Royce Lv lvroyce0210 at gmail.com
Tue Jun 5 06:21:10 UTC 2012


Libvirt-socket-rw and libvirt-socket-ro are not used only for libvirt or
root user,
but also for  unprivileged application such as vdsm,
Restrain the rundir only read/search for libvirt prevent comunication
with unprivileged client,change rundir the permission equals to the sockets
permission.
See bug:
https://bugzilla.redhat.com/show_bug.cgi?id=828073

Signed-off-by: lvroyce <lvroyce at linux.vnet.ibm.com>
---
 daemon/libvirtd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index c74cd43..6095072 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -293,7 +293,7 @@ daemonUnixSocketPaths(struct daemonConfig *config,
             if (!(rundir = virGetUserRuntimeDirectory()))
                 goto error;

-            old_umask = umask(077);
+            old_umask = umask(022);
             if (virFileMakePath(rundir) < 0) {
                 umask(old_umask);
                 goto error;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120605/ff8fb709/attachment-0001.htm>


More information about the libvir-list mailing list