diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index dc55c38..b9f2a57 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -1,15 +1,15 @@ -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.17.3/scripts/fixfiles ---- nsapolicycoreutils/scripts/fixfiles 2004-08-10 15:45:13.000000000 -0400 -+++ policycoreutils-1.17.3/scripts/fixfiles 2004-08-26 11:39:22.000000000 -0400 -@@ -36,6 +36,7 @@ +--- policycoreutils-1.17.5/scripts/fixfiles.rhat 2004-08-30 11:46:47.000000000 -0400 ++++ policycoreutils-1.17.5/scripts/fixfiles 2004-09-09 13:15:06.671123616 -0400 +@@ -36,6 +36,8 @@ FILESYSTEMSRO=`mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)' | awk '/(ext[23]| xfs | reiserfs ).*\(ro/{print $3}';` FILESYSTEMS="$FILESYSTEMSRW $FILESYSTEMSRO" SELINUXTYPE="targeted" -+FCFILE=`mktemp /var/tmp/file_contexts.XXXXXXXXXX` ++FCFILE=`mktemp /var/tmp/file_contexts.XXXXXXXXXX` ++trap "rm -f $FCFILE; exit 2" 1 2 3 5 15 if [ -e /etc/selinux/config ]; then . /etc/selinux/config -@@ -55,7 +56,7 @@ +@@ -55,7 +57,7 @@ echo "Warning: Skipping the following R/O filesystems:" echo "$FILESYSTEMSRO" fi @@ -18,7 +18,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc fi } -@@ -70,7 +71,7 @@ +@@ -70,7 +72,7 @@ echo "Warning: Skipping the following R/O filesystems:" echo "$FILESYSTEMSRO" fi @@ -27,7 +27,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc fi } -@@ -87,22 +88,22 @@ +@@ -87,22 +89,22 @@ echo "Warning: Skipping the following R/O filesystems:" echo "$FILESYSTEMSRO" fi @@ -63,19 +63,20 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc } -@@ -110,6 +111,11 @@ +@@ -110,6 +112,12 @@ echo $"Usage: $0 {-R rpmpackage[,rpmpackage...] [-l logfile ] [-o outputfile ] |check|restore|[-F] relabel}" } +if [ $# = 0 ]; then + usage ++ rm -f $FCFILE + exit 1 +fi + # See how we were called. for i in $@; do if [ $rpmFlag = 2 ]; then -@@ -127,6 +133,7 @@ +@@ -127,6 +135,7 @@ logfileFlag=1 continue fi @@ -83,8 +84,17 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc case "$i" in check) checkFlag=1 -@@ -158,15 +165,25 @@ +@@ -151,22 +160,38 @@ + ;; + *) + usage ++ rm -f $FCFILE + exit 1 + esac + done + if [ `expr $checkFlag + $restoreFlag + $relabelFlag` -gt 1 ]; then usage ++ rm -f $FCFILE exit 1 fi + @@ -97,7 +107,11 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc +done + +if [ $logfileFlag = 0 ]; then -+ LOGFILE=`mktemp /var/tmp/fixfiles.XXXXXXXXXX` || exit 1 ++ LOGFILE="/dev/null" ++ if [ ! -w $LOGFILE ] ; then ++ rm -f $FCFILE ++ exit 1 ++ fi +fi + if [ $checkFlag = 1 ]; then @@ -112,11 +126,12 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc if [ $relabelFlag = 1 ]; then if [ $fullFlag = 1 ]; then relabel $rpmFiles -@@ -174,6 +191,8 @@ +@@ -174,6 +199,6 @@ relabelCheck $rpmFiles fi fi -+ -+rm $FCFILE - exit $? +-exit $? +- ++rm $FCFILE ++exit $? diff --git a/policycoreutils.spec b/policycoreutils.spec index af16a8e..453105c 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -1,11 +1,12 @@ Summary: SELinux policy core utilities. Name: policycoreutils Version: 1.17.5 -Release: 1 +Release: 2 License: GPL Group: System Environment/Base Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz Patch: policycoreutils-rhat.patch + Prefix: %{_prefix} BuildRequires: libselinux-devel >= 1.15.3 pam-devel libsepol-devel >= 1.1.1 Requires: libselinux >= 1.15.3 libsepol >= 1.1.1 @@ -76,6 +77,9 @@ rm -rf ${RPM_BUILD_ROOT} %changelog +* Mon Sep 9 2004 Dan Walsh 1.17.5-2 +- Add Steve Grubb patch to cleanup log files. + * Mon Aug 30 2004 Dan Walsh 1.17.5-1 - Add optargs - Update to match NSA