[pbuilder] 03/03: modules: for selinux, only check for the precense of the selinux mount, instead of using selinuxenabled
Mattia Rizzolo
mattia at debian.org
Fri May 27 21:48:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository pbuilder.
commit 4697d2e9b61b5a8747514cc8ed67a9009f6fb2f3
Author: Mattia Rizzolo <mattia at debian.org>
Date: Fri May 27 21:48:10 2016 +0000
modules: for selinux, only check for the precense of the selinux mount, instead of using selinuxenabled
Closes: #506917
---
pbuilder-modules | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pbuilder-modules b/pbuilder-modules
index 5b4ed85..b5188a9 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -22,6 +22,7 @@
hooks=tmp/hooks
DEB_BUILD_ARCH_OS=$(dpkg-architecture -qDEB_BUILD_ARCH_OS)
+SELINUX="$(grep -m 1 ^selinuxfs /proc/mounts | cut -d ' ' -f 2)"
function showhelp () {
cat <<EOF
@@ -226,8 +227,8 @@ function umountproc () {
for mnt in $reversed; do
umount_one "${mnt#*:}"
done
- if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
- umount_one "$(grep -m 1 ^selinuxfs /proc/mounts | cut -d ' ' -f 2)"
+ if [ -n "$SELINUX" ]; then
+ umount_one "$SELINUX"
fi
if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USEDEVPTS" = "yes" ]; then
umount_one "dev/pts"
@@ -312,9 +313,8 @@ function mountproc () {
mount -t devpts none "$BUILDPLACE/dev/pts" -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE
mounted[${#mounted[@]}]="$BUILDPLACE/dev/pts"
fi
- if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
+ if [ -n "$SELINUX" ]; then
log.i "mounting selinux filesystem"
- local SELINUX="$(grep -m 1 ^selinuxfs /proc/mounts | cut -d ' ' -f 2)"
mkdir -p "$BUILDPLACE/$SELINUX"
mount --bind "$SELINUX" "$BUILDPLACE/$SELINUX"
mount -o remount,ro,bind "$BUILDPLACE/$SELINUX"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/pbuilder.git
More information about the Pbuilder-maint
mailing list