From 604ce3d85a879aa50c045b1f36c0580748b72eb7 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 10 Sep 2021 07:22:12 +0200 Subject: [PATCH] s4/regpatch: don't ignore unknown options BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- source4/lib/registry/tools/regpatch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 281a7fef43a..2be78d143ef 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -77,6 +77,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); + } } ev_ctx = s4_event_context_init(NULL);