Skip to content
Snippets Groups Projects
Unverified Commit b6241cb1 authored by nl6720's avatar nl6720
Browse files

Don't require root privileges just to show a "No command specified" error

Check if a profile or command is specified before looking at EUID.
parent 55cfb8ba
No related branches found
No related tags found
1 merge request!77Don't require root privileges just to show a "No command specified" error
Pipeline #2064 passed
......@@ -827,16 +827,16 @@ while getopts 'p:r:C:L:P:A:D:w:o:s:c:g:vh?' arg; do
esac
done
if (( OPTIND <= 1 )); then
_msg_error "No command specified" 0
_usage 1
fi
if (( EUID != 0 )); then
_msg_error "${app_name} must be run as root." 1
fi
shift $((OPTIND - 1))
if (( $# < 1 )); then
_msg_error "No command specified" 0
_usage 1
fi
command_name="${1}"
# Set directory path defaults for legacy commands
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment