mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-03 08:47:42 +00:00
policycoreutils: fixfiles should handle path arguments more robustly
E.g. `fixfiles restore -v /usr` - before: Warning: Skipping the following R/O filesystems: /sys/fs/cgroup Progress and Verbose mutually exclusive usage: /sbin/restorecon [-iFnprRv0] [-e excludedir] pathname... usage: /sbin/restorecon [-iFnprRv0] [-e excludedir] -f filename Warning: Skipping the following R/O filesystems: /sys/fs/cgroup 229k after: Warning: Skipping the following R/O filesystems: /sys/fs/cgroup /sbin/restorecon: lstat(-v) failed: No such file or directory Warning: Skipping the following R/O filesystems: /sys/fs/cgroup 229k This matches the usage shown in the manual page. While we're in there, we should handle spaces as well e.g `fixfiles restore "a b"`. Before: Warning: Skipping the following R/O filesystems: /sys/fs/cgroup /sbin/restorecon: lstat(b) failed: No such file or directory After: Warning: Skipping the following R/O filesystems: /sys/fs/cgroup /sbin/restorecon: lstat(a b) failed: No such file or directory Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
This commit is contained in:
parent
6e3c3595b1
commit
8c662db964
@ -248,7 +248,7 @@ if [ ! -z "$RPMFILES" ]; then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ ! -z "$FILEPATH" ]; then
|
if [ ! -z "$FILEPATH" ]; then
|
||||||
${RESTORECON} $exclude_dirs ${FORCEFLAG} ${VERBOSE} -R $* $FILEPATH 2>&1 | cat >> $LOGFILE
|
${RESTORECON} $exclude_dirs ${FORCEFLAG} ${VERBOSE} -R $* -- "$FILEPATH" 2>&1 | cat >> $LOGFILE
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ -n "${FILESYSTEMSRW}" ]; then
|
if [ -n "${FILESYSTEMSRW}" ]; then
|
||||||
@ -400,7 +400,7 @@ else
|
|||||||
process $command
|
process $command
|
||||||
else
|
else
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
FILEPATH=$1
|
FILEPATH="$1"
|
||||||
process $command
|
process $command
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user