mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-07 05:25:25 +00:00
Don't mount selinux fs in LXC if selinux is disabled
Before trying to mount the selinux filesystem in a container
use is_selinux_enabled() to check if the machine actually
has selinux support (eg not booted with selinux=0)
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 95c6cc344b
)
This commit is contained in:
parent
269dfa0e08
commit
647156870e
@ -705,6 +705,12 @@ static int lxcContainerMountBasicFS(bool pivotRoot,
|
||||
(access(srcpath, R_OK) < 0))
|
||||
continue;
|
||||
|
||||
#if WITH_SELINUX
|
||||
if (STREQ(mnts[i].src, SELINUX_MOUNT) &&
|
||||
!is_selinux_enabled())
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (virFileMakePath(mnts[i].dst) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Failed to mkdir %s"),
|
||||
|
Loading…
Reference in New Issue
Block a user