]> xenbits.xensource.com Git - libvirt.git/commitdiff
Use global directory as UML's monitorDir for privileged connections
authorSoren Hansen <soren@linux2go.dk>
Tue, 31 Aug 2010 11:44:16 +0000 (13:44 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 31 Aug 2010 16:28:57 +0000 (10:28 -0600)
For privileged UML connections (uml:///system), we shouldn't use root's
home dir, but rather somewhere in /var/run/libvirt/uml-guest.

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

Signed-off-by: Soren Hansen <soren@linux2go.dk>
src/uml/uml_driver.c

index 8b129b7cc478667050e82581757e3859efa48947..0a5c8291b11a8ae70c78117790ed212a56ba8916 100644 (file)
@@ -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-guest", 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).