Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/
Date: Thu, 05 Apr 2012 16:45:51
Message-Id: 1333644055.42694ba42b4d265a07e91bc0aef98dbfa7ad2c4f.zmedico@gentoo
1 commit: 42694ba42b4d265a07e91bc0aef98dbfa7ad2c4f
2 Author: Sven Vermeulen <swift <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 5 16:40:55 2012 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 5 16:40:55 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=42694ba4
7
8 Support /sys/fs/selinux/context for bug #410687.
9
10 ---
11 bin/misc-functions.sh | 6 ++++--
12 1 files changed, 4 insertions(+), 2 deletions(-)
13
14 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
15 index b083897..4e81ddf 100755
16 --- a/bin/misc-functions.sh
17 +++ b/bin/misc-functions.sh
18 @@ -1095,13 +1095,15 @@ preinst_selinux_labels() {
19 # SELinux file labeling (needs to always be last in dyn_preinst)
20 # only attempt to label if setfiles is executable
21 # and 'context' is available on selinuxfs.
22 - if [ -f /selinux/context -a -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
23 + if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
24 + [ -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
25 vecho ">>> Setting SELinux security labels"
26 (
27 eval "$(/usr/sbin/selinuxconfig)" || \
28 die "Failed to determine SELinux policy paths.";
29
30 - addwrite /selinux/context;
31 + addwrite /selinux/context
32 + addwrite /sys/fs/selinux/context
33
34 /usr/sbin/setfiles "${file_contexts_path}" -r "${D}" "${D}"
35 ) || die "Failed to set SELinux security labels."