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:
William Hubbs 2014-07-11 14:50:20 -05:00
parent 75e06d8558
commit d0040aff0a

View File

@ -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;