[PATCH] Use global directory as UML's monitorDir for privileged connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For privileged UML connections (uml:///system), we shouldn't use root's
home dir, but rather somewhre in /var/run/libvirt/uml.

https://bugzilla.redhat.com/show_bug.cgi?id=499536

Signed-off-by: Soren Hansen <soren@xxxxxxxxxxx>
---
 src/uml/uml_driver.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 8b129b7..c8b9997 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -373,6 +373,10 @@ umlStartup(int privileged) {
 
         if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
             goto out_of_memory;
+
+        if (virAsprintf(&uml_driver->monitorDir,
+                        "%s/run/libvirt/uml", LOCAL_STATE_DIR) == -1)
+            goto out_of_memory;
     } else {
 
         if (virAsprintf(&uml_driver->logDir,
@@ -381,11 +385,11 @@ umlStartup(int privileged) {
 
         if (virAsprintf(&base, "%s/.libvirt", userdir) == -1)
             goto out_of_memory;
-    }
 
-    if (virAsprintf(&uml_driver->monitorDir,
-                    "%s/.uml", userdir) == -1)
-        goto out_of_memory;
+        if (virAsprintf(&uml_driver->monitorDir,
+                        "%s/.uml", userdir) == -1)
+            goto out_of_memory;
+    }
 
     /* Configuration paths are either ~/.libvirt/uml/... (session) or
      * /etc/libvirt/uml/... (system).
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]