diff options
author | Justin Stephenson <jstephen@redhat.com> | 2016-09-29 11:17:20 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-10-10 12:08:41 +0200 |
commit | 1330390c698ca0802200725df43356557aa633a2 (patch) | |
tree | 9502ce818545effb7a7478f29f356effbfd80109 /src/tools | |
parent | a5b4f865aae08d978e7bbbe1ff5c4b93ac41aa85 (diff) | |
download | sssd-1330390c698ca0802200725df43356557aa633a2.tar.gz sssd-1330390c698ca0802200725df43356557aa633a2.tar.xz sssd-1330390c698ca0802200725df43356557aa633a2.zip |
sss_cache: improve option argument handling
Print informational message and exit when multiple arguments are provided
for single-argument options with sss_cache
Resolves:
https://fedorahosted.org/sssd/ticket/3180
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/sss_cache.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c index 8b78b29f1..f1d08937f 100644 --- a/src/tools/sss_cache.c +++ b/src/tools/sss_cache.c @@ -745,6 +745,14 @@ static errno_t init_context(int argc, const char *argv[], BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini); } + if (poptGetArg(pc)) { + BAD_POPT_PARAMS(pc, + _("Unexpected argument(s) provided, options that " + "invalidate a single object only accept a single " + "provided argument.\n"), + ret, fini); + } + if (idb == INVALIDATE_NONE && !values.user && !values.group && !values.netgroup && !values.service && !values.map && !values.ssh_host && !values.sudo_rule) { |