提交 95c6cc34 编写于 作者: D Daniel P. Berrange

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: NDaniel P. Berrange <berrange@redhat.com>
上级 ba5f3c7c
......@@ -702,6 +702,12 @@ static int lxcContainerMountBasicFS(char *sec_mount_options)
(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"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册