nmblookup: don't ignore unknown options
authorRalph Boehme <slow@samba.org>
Thu, 9 Sep 2021 16:15:51 +0000 (18:15 +0200)
committerJule Anger <janger@samba.org>
Mon, 13 Sep 2021 07:48:08 +0000 (07:48 +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>
(cherry picked from commit 98c977f44b6086e2c5cec52451078a6ade81d4a8)

libcli/nbt/tools/nmblookup.c

index 689240f90a4ddb68c7de7e5a0f6cb03f4a00ad49..6ca38faa863444c4ae1287d1b0ef369d17956735 100644 (file)
@@ -433,6 +433,11 @@ int main(int argc, const char *argv[])
                case OPT_CASE_SENSITIVE:
                        options.case_sensitive = true;
                        break;
+               case POPT_ERROR_BADOPT:
+                       fprintf(stderr, "\nInvalid option %s: %s\n\n",
+                               poptBadOption(pc, 0), poptStrerror(opt));
+                       poptPrintUsage(pc, stderr, 0);
+                       exit(1);
                }
        }