summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorChris PeBenito <pebenito@gentoo.org>2004-10-08 01:36:47 +0000
committerChris PeBenito <pebenito@gentoo.org>2004-10-08 01:36:47 +0000
commitbc66e7ca5d38250902dfd5fffc77bdbccbc6ad56 (patch)
treeca3e7e8d118e3b0e8e5b13f7b32a22dd1491d062 /eclass
parentmips stable for security #66251 (diff)
downloadhistorical-bc66e7ca5d38250902dfd5fffc77bdbccbc6ad56.tar.gz
historical-bc66e7ca5d38250902dfd5fffc77bdbccbc6ad56.tar.bz2
historical-bc66e7ca5d38250902dfd5fffc77bdbccbc6ad56.zip
fix for bug #65487. only do loadpolicy if all tools are available
Diffstat (limited to 'eclass')
-rw-r--r--eclass/selinux-policy.eclass34
1 files changed, 19 insertions, 15 deletions
diff --git a/eclass/selinux-policy.eclass b/eclass/selinux-policy.eclass
index 0435a15f0cec..43d51c2ae21f 100644
--- a/eclass/selinux-policy.eclass
+++ b/eclass/selinux-policy.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy.eclass,v 1.11 2004/09/06 01:09:02 pebenito Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy.eclass,v 1.12 2004/10/08 01:36:47 pebenito Exp $
# Eclass for installing SELinux policy, and optionally
# reloading the policy
@@ -64,20 +64,24 @@ selinux-policy_src_install() {
selinux-policy_pkg_postinst() {
if has "loadpolicy" $FEATURES ; then
- ebegin "Automatically loading policy"
- make -C ${POLICYDIR} load
- eend $?
-
- ebegin "Regenerating file contexts"
- [ -f ${POLICYDIR}/file_contexts/file_contexts ] && \
- rm -f ${POLICYDIR}/file_contexts/file_contexts
- make -C ${POLICYDIR} file_contexts/file_contexts &> /dev/null
-
- # do a test relabel to make sure file
- # contexts work (doesnt change any labels)
- echo "/etc/passwd" | /usr/sbin/setfiles \
- ${POLICYDIR}/file_contexts/file_contexts -sqn
- eend $?
+ if [ -x /usr/bin/checkpolicy -a -x /usr/sbin/load_policy -a -x /usr/sbin/setfiles ]; then
+ # only do this if all tools are installed
+
+ ebegin "Automatically loading policy"
+ make -C ${POLICYDIR} load
+ eend $?
+
+ ebegin "Regenerating file contexts"
+ [ -f ${POLICYDIR}/file_contexts/file_contexts ] && \
+ rm -f ${POLICYDIR}/file_contexts/file_contexts
+ make -C ${POLICYDIR} file_contexts/file_contexts &> /dev/null
+
+ # do a test relabel to make sure file
+ # contexts work (doesnt change any labels)
+ echo "/etc/passwd" | /usr/sbin/setfiles \
+ ${POLICYDIR}/file_contexts/file_contexts -sqn
+ eend $?
+ fi
else
echo
echo