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

index de14132a2df15785088b29ae8743ddbe0720f692..812698e49db6d5c24280b49dc56e00651a8b42a0 100644 (file)
@@ -669,7 +669,13 @@ int main(int argc, char *argv[])
        }
 
        while ((i = poptGetNextOpt(pctx)) != -1) {
-               ;
+               switch (i) {
+               case POPT_ERROR_BADOPT:
+                       fprintf(stderr, "\nInvalid option %s: %s\n\n",
+                               poptBadOption(pctx, 0), poptStrerror(i));
+                       poptPrintUsage(pctx, stderr, 0);
+                       exit(1);
+               }
        }
 
        for (dd_args = poptGetArgs(pctx); dd_args && *dd_args; ++dd_args) {