tmpfiles: fix relabel to run restorecon before chown and chmod

This commit is contained in:
William Hubbs 2014-08-13 15:26:37 -05:00
parent 6f080e9c1a
commit c8018d04a7

View File

@ -45,10 +45,10 @@ relabel() {
for path in ${paths}; do
if [ -e "$path" ]; then
[ -x /sbin/restorecon ] && dryrun_or_real restorecon $CHOPTS "$path"
[ $uid != '-' ] && dryrun_or_real chown $CHOPTS "$uid" "$path"
[ $gid != '-' ] && dryrun_or_real chgrp $CHOPTS "$gid" "$path"
[ $mode != '-' ] && dryrun_or_real chmod $CHOPTS "$mode" "$path"
[ -x /sbin/restorecon ] && dryrun_or_real restorecon $CHOPTS "$path"
fi
done
}