@@ -216,11 +216,11 @@ shift
case "$RESTORE_MODE" in
PREFC)
diff_filecontext $*
- exit $?
+ return
;;
BOOTTIME)
newer $BOOTTIME $*
- exit $?
+ return
;;
esac
@@ -234,11 +234,9 @@ case "$RESTORE_MODE" in
for i in `echo "$RPMFILES" | sed 's/,/ /g'`; do
rpmlist $i | ${RESTORECON} ${EXCLUDEDIRS} ${FORCEFLAG} ${VERBOSE} $* -R -i -f -
done
- exit $?
;;
FILEPATH)
${RESTORECON} ${EXCLUDEDIRS} ${FORCEFLAG} ${VERBOSE} -R $* -- "$FILEPATH"
- return # to loop over each FILEPATH
;;
DEFAULT)
if [ -n "${FILESYSTEMSRW}" ]; then
@@ -261,7 +259,6 @@ case "$RESTORE_MODE" in
find /var/tmp \( -context "*:${UNLABELED}*" -o -context "*:${UNDEFINED}*" \) -exec chcon --reference /var/tmp {} \;
find /var/run \( -context "*:${UNLABELED}*" -o -context "*:${UNDEFINED}*" \) -exec chcon --reference /var/run {} \;
[ ! -e /var/lib/debug ] || find /var/lib/debug \( -context "*:${UNLABELED}*" -o -context "*:${UNDEFINED}*" \) -exec chcon --reference /lib {} \;
- exit 0
;;
esac
}
@@ -269,17 +266,19 @@ esac
fullrelabel() {
echo "Cleaning out /tmp"
find /tmp/ -mindepth 1 -delete
- LogReadOnly
restore Relabel
}
+
relabel() {
- if [ "$RESTORE_MODE" == RPMFILES ]; then
- restore Relabel
+ if [ "$RESTORE_MODE" != DEFAULT ]; then
+ usage
+ exit 1
fi
if [ $fullFlag == 1 ]; then
fullrelabel
+ return
fi
echo -n "
@@ -306,6 +305,10 @@ case "$1" in
verify) restore Verify -n;;
relabel) relabel;;
onboot)
+ if [ "$RESTORE_MODE" != DEFAULT ]; then
+ usage
+ exit 1
+ fi
> /.autorelabel
[ -z "$FORCEFLAG" ] || echo -n "$FORCEFLAG " >> /.autorelabel
[ -z "$BOOTTIME" ] || echo -N $BOOTTIME >> /.autorelabel
@@ -320,9 +323,11 @@ esac
}
usage() {
echo $"""
-Usage: $0 [-v] [-F] { check | restore | [-f] relabel | verify } dir/file ...
+Usage: $0 [-v] [-F] [-f] relabel
+or
+Usage: $0 [-v] [-F] [-B | -N time ] { check | restore | verify }
or
-Usage: $0 [-v] [-F] [-B | -N time ] { check | restore | [-f] relabel | verify }
+Usage: $0 [-v] [-F] { check | restore | verify } dir/file ...
or
Usage: $0 [-v] [-F] -R rpmpackage[,rpmpackage...] { check | restore | verify }
or
@@ -408,4 +413,3 @@ else
process "$command"
fi
-exit $?
@@ -6,10 +6,13 @@ fixfiles \- fix file SELinux security contexts.
.na
.B fixfiles
-.I [\-v] [\-F] { check | restore | [\-f] relabel | verify } dir/file ...
+.I [\-v] [\-F] [\-f] relabel
.B fixfiles
-.I [\-v] [\-F] [\-B | \-N time ] { check | restore | [\-f] relabel | verify }
+.I [\-v] [\-F] { check | restore | verify } dir/file ...
+
+.B fixfiles
+.I [\-v] [\-F] [\-B | \-N time ] { check | restore | verify }
.B fixfiles
.I [\-v] [\-F] \-R rpmpackagename[,rpmpackagename...] { check | restore | verify }