smbstatus: don't ignore unknown options
authorRalph Boehme <slow@samba.org>
Fri, 10 Sep 2021 03:46:27 +0000 (05:46 +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/status.c

index 778af6d97ade30eb6cea4103f15893b79260dbd6..a92881700099320bef2fc19635a3f8c1ea5b4076 100644 (file)
@@ -754,6 +754,11 @@ int main(int argc, const char *argv[])
                case OPT_RESOLVE_UIDS:
                        resolve_uids = true;
                        break;
+               case POPT_ERROR_BADOPT:
+                       fprintf(stderr, "\nInvalid option %s: %s\n\n",
+                               poptBadOption(pc, 0), poptStrerror(c));
+                       poptPrintUsage(pc, stderr, 0);
+                       exit(1);
                }
        }