]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/regpatch: don't ignore unknown options
authorRalph Boehme <slow@samba.org>
Fri, 10 Sep 2021 05:22:12 +0000 (07:22 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 10 Sep 2021 15:10:30 +0000 (15:10 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/lib/registry/tools/regpatch.c

index 281a7fef43a9b2e4438cf4caba9b9f2760b80a93..2be78d143efa79bac516736ed694a4a186fde3ba 100644 (file)
@@ -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);