checkpath: report an error if required options were not specified
Before this commit, not specifying -d, -f, -p or -W in a checkpath command meant the command exited successfully but actually did nothing. This is an error condition, so report it as such.
This commit is contained in:
parent
75e06d8558
commit
d0040aff0a
@ -267,6 +267,9 @@ checkpath(int argc, char **argv)
|
|||||||
if (optind >= argc)
|
if (optind >= argc)
|
||||||
usage(EXIT_FAILURE);
|
usage(EXIT_FAILURE);
|
||||||
|
|
||||||
|
if (type == inode_unknown)
|
||||||
|
eerrorx("%s: -d -f or -p must be specified.", applet);
|
||||||
|
|
||||||
if (pw) {
|
if (pw) {
|
||||||
uid = pw->pw_uid;
|
uid = pw->pw_uid;
|
||||||
gid = pw->pw_gid;
|
gid = pw->pw_gid;
|
||||||
|
Loading…
Reference in New Issue
Block a user