diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-04-07 10:55:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-07 10:55:30 +0200 |
commit | ddd43f31e3be45a276ec4191eace333f844b98b8 (patch) | |
tree | b92573d9b4beb6a6e3f049993f27349273110e40 /src/ask-password | |
parent | 9c1d3d6fa7f00673c0f650139cf5e9a3d4f37827 (diff) | |
parent | 6339d3e6021f31a8a8907c2613f1aaac279fe745 (diff) | |
download | systemd-ddd43f31e3be45a276ec4191eace333f844b98b8.tar.gz |
Merge pull request #26887 from yuwata/proc-cmdline-filter-arguments
proc-cmdline: filter PID1 arguments on container
Diffstat (limited to 'src/ask-password')
-rw-r--r-- | src/ask-password/ask-password.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ask-password/ask-password.c b/src/ask-password/ask-password.c index c02e3b42fe..de41d7b641 100644 --- a/src/ask-password/ask-password.c +++ b/src/ask-password/ask-password.c @@ -108,6 +108,10 @@ static int parse_argv(int argc, char *argv[]) { /* Note the asymmetry: the long option --echo= allows an optional argument, the short option does * not. */ + + /* Resetting to 0 forces the invocation of an internal initialization routine of getopt_long() + * that checks for GNU extensions in optstring ('-' or '+' at the beginning). */ + optind = 0; while ((c = getopt_long(argc, argv, "+hen", options, NULL)) >= 0) switch (c) { |