summaryrefslogtreecommitdiffstats
path: root/py
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2010-08-03 12:57:24 -0500
committerClark Williams <williams@redhat.com>2010-08-03 12:57:24 -0500
commit12f0cd8da491039ed13c7fffaafd6ae96e267410 (patch)
tree01f29f78dd27e862bd0dc3810943e1e480556b1d /py
parent967fdcadf16782edea28f4e6a8a735cd3acb7348 (diff)
downloadmock-12f0cd8da491039ed13c7fffaafd6ae96e267410.tar.gz
mock-12f0cd8da491039ed13c7fffaafd6ae96e267410.tar.xz
mock-12f0cd8da491039ed13c7fffaafd6ae96e267410.zip
set state correctly for SELinux (BZ# 620143)
The new selinux plugin fakes SELinux being turned *off* in the chroot by bind-mounting a fake /proc/filesystems in the chroot. If this plugin is enabled, we should *not* do any SELinux attribute operations in the chroot. Setup this state correctly at init time. Signed-off-by: Clark Williams <williams@redhat.com>
Diffstat (limited to 'py')
-rw-r--r--py/mock/backend.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/py/mock/backend.py b/py/mock/backend.py
index 7aac040..eb97219 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -101,8 +101,14 @@ class Root(object):
self.state("init plugins")
self._initPlugins()
- # figure out if SELinux is enabled on the host
- self.selinux = mock.util.selinuxEnabled()
+ # default to not doing selinux things
+ self.selinux = False
+
+ # if the selinux plugin is disabled and we have SELinux enabled
+ # on the host, we need to do SELinux things, so set the selinux
+ # state variable to true
+ if self.pluginConf['selinux_enable'] == False and mock.util.selinuxEnabled():
+ self.selinux = True
# officially set state so it is logged
self.state("start")