diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles index 7e5ce881..dae073d6 100755 --- a/policycoreutils/scripts/fixfiles +++ b/policycoreutils/scripts/fixfiles @@ -101,15 +101,6 @@ exclude_dirs_from_relabelling() { echo "$exclude_from_relabelling" } -exclude_dirs() { - exclude= - for i in /sys /proc /dev /run /mnt /var/tmp /var/lib/BackupPC /home /tmp /dev; do - [ -e $i ] && exclude="$exclude -e $i"; - done - exclude="$exclude `exclude_dirs_from_relabelling`" - echo "$exclude" -} - # # Set global Variables # @@ -162,6 +153,12 @@ newer() { # run restorecon on all files affected by the differences. # diff_filecontext() { +exclude_dirs= +for i in /sys /proc /dev /run /mnt /var/tmp /var/lib/BackupPC /home /tmp /dev; do + [ -e $i ] && exclude_dirs="$exclude_dirs -e $i"; +done +exclude_dirs="$exclude_dirs `exclude_dirs_from_relabelling`" + if [ -f ${PREFC} -a -x /usr/bin/diff ]; then TEMPFILE=`mktemp ${FC}.XXXXXXXXXX` test -z "$TEMPFILE" && exit @@ -191,7 +188,7 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then esac; \ fi; \ done | \ - ${RESTORECON} ${VERBOSE} -i -f - -R $* `exclude_dirs`; \ + ${RESTORECON} ${VERBOSE} -i -f - -R $* $exclude_dirs; \ rm -f ${TEMPFILE} ${PREFCTEMPFILE} fi }