mirror of
https://github.com/SELinuxProject/selinux
synced 2025-05-02 07:37:59 +00:00
policycoreutils: fixfiles: usage errors are fatal
The idea is to print a usage error, then terminate with EXIT_FAILURE. Don't print the usage error twice when run with no command. Don't try to check for bogus extra arguments _after_ performing a long-running operation... particularly if that operation terminates the script with EXIT_SUCCESS first. Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
This commit is contained in:
parent
658800ef3d
commit
2aa88f7201
@ -365,6 +365,7 @@ shift $(( OPTIND - 1 ))
|
|||||||
command="$1"
|
command="$1"
|
||||||
if [ -z "$command" ]; then
|
if [ -z "$command" ]; then
|
||||||
usage
|
usage
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Move out command from arguments
|
# Move out command from arguments
|
||||||
@ -375,10 +376,11 @@ shift
|
|||||||
#
|
#
|
||||||
|
|
||||||
if [ ! -z "$RPMFILES" ]; then
|
if [ ! -z "$RPMFILES" ]; then
|
||||||
process "$command"
|
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
usage
|
usage
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
process "$command"
|
||||||
else
|
else
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
process "$command"
|
process "$command"
|
||||||
|
Loading…
Reference in New Issue
Block a user