diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-11-24 17:01:32 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-24 17:01:32 +0100 |
commit | b068c6f587076fdb870b0f1ac2e10e36f1987520 (patch) | |
tree | 1d3290ba3cb4ff64e8129f13952738d16b40dbad /src/systemctl | |
parent | Merge pull request #7446 from poettering/efi-firmware-boot-fixes (diff) | |
download | systemd-b068c6f587076fdb870b0f1ac2e10e36f1987520.tar.xz systemd-b068c6f587076fdb870b0f1ac2e10e36f1987520.zip |
systemctl: ignore shutdown's "-t" argument (#7459)
We should not only ignore "-t" itself, but also whatever is passed to
it.
This pretty much reverts the core of
a4420f7b8ed73b05ef6f31622101e7804daef69f, and adds back in the status
quo ante. What a difference a ':' can make.
This also adds a quick comment for this, so that we don't make this
mistake again.
Fixes: #7413
Diffstat (limited to '')
-rw-r--r-- | src/systemctl/systemctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index ae11bf1ded..4fd9b10634 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -8084,7 +8084,7 @@ static int shutdown_parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "HPrhkKtafFc", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "HPrhkKat:fFc", options, NULL)) >= 0) switch (c) { case ARG_HELP: @@ -8123,8 +8123,8 @@ static int shutdown_parse_argv(int argc, char *argv[]) { arg_no_wall = true; break; - case 't': case 'a': + case 't': /* Note that we also ignore any passed argument to -t, not just the -t itself */ case 'f': case 'F': /* Compatibility nops */ |