Ensure LXC security driver is set unconditonally

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>
(cherry picked from commit 3746b070e7)
This commit is contained in:
Daniel P. Berrange 2012-05-01 10:46:08 +01:00 committed by Cole Robinson
parent 75a5c8225b
commit aa829d7bcd

View 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);