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

index f8b5246a43ed5bb575ccce49bf494753ed02d19a..2ee2f82af98e80bcb9249d9f8c67dbb17dc16b0a 100644 (file)
@@ -334,6 +334,11 @@ int main(int argc, const 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);
                }
        }