aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Vermeulen <swift@gentoo.org>2012-04-05 16:40:55 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-04-05 16:40:55 (GMT)
commit42694ba42b4d265a07e91bc0aef98dbfa7ad2c4f (patch)
treee53e4c67ab9ff1ccfb684c0238db824c45fa44c7
parentunmerge: display progress counter, bug #386901 (diff)
downloadportage-42694ba42b4d265a07e91bc0aef98dbfa7ad2c4f.zip
portage-42694ba42b4d265a07e91bc0aef98dbfa7ad2c4f.tar.gz
portage-42694ba42b4d265a07e91bc0aef98dbfa7ad2c4f.tar.bz2
Support /sys/fs/selinux/context for bug #410687.
-rwxr-xr-xbin/misc-functions.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index b083897..4e81ddf 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1095,13 +1095,15 @@ preinst_selinux_labels() {
# SELinux file labeling (needs to always be last in dyn_preinst)
# only attempt to label if setfiles is executable
# and 'context' is available on selinuxfs.
- if [ -f /selinux/context -a -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
+ if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
+ [ -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
vecho ">>> Setting SELinux security labels"
(
eval "$(/usr/sbin/selinuxconfig)" || \
die "Failed to determine SELinux policy paths.";
- addwrite /selinux/context;
+ addwrite /selinux/context
+ addwrite /sys/fs/selinux/context
/usr/sbin/setfiles "${file_contexts_path}" -r "${D}" "${D}"
) || die "Failed to set SELinux security labels."