From aa62e3665cba36be866d8d779c7a9ef103d85bbd Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Thu, 4 May 2017 18:01:18 +0100 Subject: [PATCH] policycoreutils: fixfiles: remove (broken) redundant code setfiles is now run with $exclude_dirs. We shouldn't need to patch the file contexts as well. This is fortunate, since the file context patching code was broken (by the same commit which introduced the redundancy). It takes the list of directories to exclude from $tempdirs, but $tempdirs is never set. Also messages about skipping directories were printed twice. Firstly when exclude_dirs is generated, and secondly in the file context patching code. Also TEMPFCFILE was only removed in one path out of several. --- policycoreutils/scripts/fixfiles | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles index 75d7762a..7e5ce881 100755 --- a/policycoreutils/scripts/fixfiles +++ b/policycoreutils/scripts/fixfiles @@ -230,21 +230,6 @@ fi LogReadOnly # exclude_dirs="`exclude_dirs_from_relabelling $OPTION`" -if [ -n "${exclude_dirs}" ] -then - TEMPFCFILE=`mktemp ${FC}.XXXXXXXXXX` - test -z "$TEMPFCFILE" && exit - /bin/cp -p ${FC} ${TEMPFCFILE} &>/dev/null || exit - tmpdirs=${tempdirs//-e/} - for p in ${tmpdirs} - do - p="${p%/}" - p1="${p}(/.*)? -- <>" - echo "${p1}" >> $TEMPFCFILE - logit "skipping the directory ${p}" - done -FC=$TEMPFCFILE -fi if [ ! -z "$RPMFILES" ]; then for i in `echo "$RPMFILES" | sed 's/,/ /g'`; do rpmlist $i | ${RESTORECON} $exclude_dirs ${FORCEFLAG} ${VERBOSE} $* -R -i -f - >>$LOGFILE 2>&1 @@ -265,7 +250,7 @@ if [ ${OPTION} != "Relabel" ]; then return fi echo "Cleaning up labels on /tmp" -rm -rf /tmp/gconfd-* /tmp/pulse-* /tmp/orbit-* $TEMPFCFILE +rm -rf /tmp/gconfd-* /tmp/pulse-* /tmp/orbit-* UNDEFINED=`get_undefined_type` || exit $? UNLABELED=`get_unlabeled_type` || exit $?