policycoreutils/policycoreutils-rhat.patch
Daniel J Walsh 83027e5586 * Fri Jan 20 2005 Dan Walsh <dwalsh@redhat.com> 1.21.3-2
- Temp file needs to be created in /etc/selinux/POLICYTYPE/contexts/files/ directory.
2005-01-24 17:39:30 +00:00

25 lines
890 B
Diff

diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.21.1/scripts/fixfiles
--- nsapolicycoreutils/scripts/fixfiles 2005-01-24 11:19:10.103136000 -0500
+++ policycoreutils-1.21.1/scripts/fixfiles 2005-01-24 11:19:28.998223000 -0500
@@ -37,11 +37,19 @@
SELINUXTYPE="targeted"
if [ -e /etc/selinux/config ]; then
. /etc/selinux/config
- FC=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
+ FC=`mktemp /etc/selinux/${SELINUXTYPE}/contexts/files/file_context.XXXXXX`
+ cat /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts.local > $FC 2> /dev/null
else
FC=/etc/security/selinux/file_contexts
fi
+cleanup() {
+ if [ -e /etc/selinux/config -a -f "$FC" ]; then
+ rm -f $FC
+ fi
+}
+trap "cleanup" 0 1 2 3 13 15
+
#
# Log to either syslog or a LOGFILE
#