From c87cc09315a169300e57a58b88587e54fcf29d8f Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 9 Sep 2021 18:14:36 +0200 Subject: [PATCH] texpect: don't ignore unknown options BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- lib/texpect/texpect.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c index 5657efa44d1..1a6ebf486ae 100644 --- a/lib/texpect/texpect.c +++ b/lib/texpect/texpect.c @@ -388,7 +388,13 @@ int main(int argc, const char **argv) } while ((optidx = poptGetNextOpt(pc)) != -1) { - ;; + switch (optidx) { + case POPT_ERROR_BADOPT: + fprintf(stderr, "\nInvalid option %s: %s\n\n", + poptBadOption(pc, 0), poptStrerror(optidx)); + poptPrintUsage(pc, stderr, 0); + exit(1); + } } instruction_file = poptGetArg(pc);