From: Ralph Boehme Date: Fri, 10 Sep 2021 05:25:30 +0000 (+0200) Subject: s4/regtree: don't ignore unknown options X-Git-Tag: ldb-2.5.0~695 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecb27e02e113c597f952457e8a7803325c4c620e;p=thirdparty%2Fsamba.git s4/regtree: don't ignore unknown options BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 6e1634b1242..1f0dac2c5f3 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -154,6 +154,13 @@ int main(int argc, char **argv) } while((opt = poptGetNextOpt(pc)) != -1) { + switch (opt) { + case POPT_ERROR_BADOPT: + fprintf(stderr, "\nInvalid option %s: %s\n\n", + poptBadOption(pc, 0), poptStrerror(opt)); + poptPrintUsage(pc, stderr, 0); + exit(1); + } } poptFreeContext(pc);