]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Ensure LXC security driver is set unconditonally
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 1 May 2012 09:46:08 +0000 (10:46 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 1 May 2012 15:05:02 +0000 (16:05 +0100)
The driver->securityDriverName field may be NULL, if automatic
probing is used to determine security driver. This meant that
unless selinux was explicitly requested in lxc.conf, it was
not being sent to the libvirt_lxc process.

The driver->securityManager field is guaranteed non-NULL, since
there will always be the 'none' security driver present if
nothing else exists. So use that to set the driver name for
libvirt_lxc

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_driver.c

index ffdd4ac5ac1bc4f4415570e994ef3a07f99b2464..03783ffbf8b80176c27aa920ffa4712d20ab3bce 100644 (file)
@@ -1616,8 +1616,8 @@ lxcBuildControllerCmd(lxc_driver_t *driver,
         virCommandPreserveFD(cmd, ttyFDs[i]);
     }
 
-    if (driver->securityDriverName)
-        virCommandAddArgPair(cmd, "--security", driver->securityDriverName);
+    virCommandAddArgPair(cmd, "--security",
+                         virSecurityManagerGetModel(driver->securityManager));
 
     virCommandAddArg(cmd, "--handshake");
     virCommandAddArgFormat(cmd, "%d", handshakefd);