s4/regtree: don't ignore unknown options
authorRalph Boehme <slow@samba.org>
Fri, 10 Sep 2021 05:25:30 +0000 (07:25 +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/regtree.c

index 6e1634b12426e13798b1561704a8f9fdb3f1e468..1f0dac2c5f319583ea03b911b0e3b9fa762cc124 100644 (file)
@@ -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);