[Piuparts-devel] Bug#682068: selinux + piuparts
Holger Levsen
holger at layer-acht.org
Sat May 18 14:07:41 UTC 2013
tags 682068 + moreinfo
thanks
Hi Laurent,
piuparts is only trying to mount selinux mountpoints if
/usr/sbin/selinuxenabled ran successfully.
I have two problems now:
- /usr/sbin/selinuxenabled doesn't even exist on my wheezy system
- isn't there some selinux tool to tell me the expected mountpoint? I don't
want to mess around with versions in piuparts.py source code (be it "wheezy",
"squeeze", 2.0.96-1 or 2.1.9-5) to decide whether to mount /selinux or
/sys/fs/selinux ?!!
See below for actual related code. That's it, plus calls to them.
cheers,
Holger
def selinux_enabled(enabled_test="/usr/sbin/selinuxenabled"):
if os.access(enabled_test, os.X_OK):
retval, output = run([enabled_test], ignore_errors=True)
if retval == 0:
return True
else:
return False
def mount_selinux(self):
if selinux_enabled():
run(["mkdir", "-p", self.relative("/selinux")])
run(["mount", "-t", "selinuxfs", "/selinux",
self.relative("/selinux")])
logging.info("SElinux mounted into chroot")
def unmount_selinux(self):
if selinux_enabled():
run(["umount", self.relative("/selinux")])
logging.info("SElinux unmounted from chroot")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20130518/402bc744/attachment.pgp>
More information about the Piuparts-devel
mailing list