From: Ralph Boehme Date: Fri, 10 Sep 2021 05:03:21 +0000 (+0200) Subject: pdbtest: don't ignore unknown options X-Git-Tag: ldb-2.5.0~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3c5516dc578aee25aaaac1ab7a66ede9d313be0;p=thirdparty%2Fsamba.git pdbtest: don't ignore unknown options BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/torture/pdbtest.c b/source3/torture/pdbtest.c index 1a95a3c8646..146320ff453 100644 --- a/source3/torture/pdbtest.c +++ b/source3/torture/pdbtest.c @@ -554,6 +554,7 @@ int main(int argc, const char **argv) struct samu *in = NULL; NTSTATUS rv; int i; + int opt; struct timeval tv; bool error = False; struct passwd *pwd; @@ -593,7 +594,15 @@ int main(int argc, const char **argv) poptSetOtherOptionHelp(pc, "backend[:settings] username"); - while(poptGetNextOpt(pc) != -1); + 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);