54 lines
1.6 KiB
Diff
54 lines
1.6 KiB
Diff
|
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.19.2/scripts/fixfiles
|
||
|
--- nsapolicycoreutils/scripts/fixfiles 2004-10-26 11:15:41.000000000 -0400
|
||
|
+++ policycoreutils-1.19.2/scripts/fixfiles 2005-01-03 13:30:04.708085304 -0500
|
||
|
@@ -53,10 +53,13 @@
|
||
|
echo $1 >> $LOGFILE
|
||
|
fi
|
||
|
}
|
||
|
+rpmlist() {
|
||
|
+rpm -q --qf '[%{FILESTATES} %{FILENAMES}\n]' "$1" | grep '^0 ' | cut -f2- -d ' '
|
||
|
+}
|
||
|
checkLabels () {
|
||
|
if [ ! -z "$1" ]; then
|
||
|
for i in `echo $1 | sed 's/,/ /g'`; do
|
||
|
- rpm -q -l $i | restorecon ${OUTFILES} -n -v -f - 2>&1 >> $LOGFILE
|
||
|
+ rpmlist $i | restorecon ${OUTFILES} -R -n -v -f - 2>&1 >> $LOGFILE
|
||
|
done
|
||
|
else
|
||
|
if [ ! -z "$FILESYSTEMSRO" ]; then
|
||
|
@@ -70,7 +73,7 @@
|
||
|
restoreLabels () {
|
||
|
if [ ! -z "$1" ]; then
|
||
|
for i in `echo $1 | sed 's/,/ /g'`; do
|
||
|
- rpm -q -l $i | restorecon ${OUTFILES} -v -f - 2>&1 >> $LOGFILE
|
||
|
+ rpmlist $i | restorecon ${OUTFILES} -R -v -f - 2>&1 >> $LOGFILE
|
||
|
done
|
||
|
else
|
||
|
if [ ! -z "$FILESYSTEMSRO" ]; then
|
||
|
@@ -82,13 +85,11 @@
|
||
|
}
|
||
|
|
||
|
relabel() {
|
||
|
-logit "Cleaning out /tmp"
|
||
|
-rm -rf /tmp/.??* /tmp/*
|
||
|
if [ ! -z "$1" ]; then
|
||
|
- for i in `echo $1 | sed 's/,/ /g'`; do
|
||
|
- rpm -q -l $i | restorecon ${OUTFILES} -v -f - 2>&1 >> $LOGFILE
|
||
|
- done
|
||
|
+ restoreLabels $1
|
||
|
else
|
||
|
+ logit "Cleaning out /tmp"
|
||
|
+ rm -rf /tmp/.??* /tmp/*
|
||
|
if [ ! -z "$FILESYSTEMSRO" ]; then
|
||
|
logit "Warning: Skipping the following R/O filesystems:"
|
||
|
logit "$FILESYSTEMSRO"
|
||
|
@@ -180,7 +181,7 @@
|
||
|
restoreLabels $rpmFiles
|
||
|
fi
|
||
|
if [ $relabelFlag = 1 ]; then
|
||
|
- if [ $fullFlag = 1 ]; then
|
||
|
+ if [ $fullFlag = 1 -o ! -z "$rpmFiles" ]; then
|
||
|
relabel $rpmFiles
|
||
|
else
|
||
|
relabelCheck $rpmFiles
|