Commit 4e8c40a4 authored by Michael Biebl's avatar Michael Biebl

systemctl: Fix argument handling when invoked as shutdown

Closes: #776997
parent 0092dd05
......@@ -168,6 +168,8 @@ units-order-systemd-user-sessions.service-after-network.t.patch
pid1-don-t-return-any-error-in-manager_dispatch_noti.patch
polkit-don-t-start-polkit-agent-when-running-as-root.patch
core-rework-logic-to-determine-when-we-decide-to-add-auto.patch
systemctl-fix-argument-handling-when-invoked-as-shutdown.patch
systemctl-when-reading-legacy-t-argument-for-shutdown-don.patch
## Debian specific patches:
Add-back-support-for-Debian-specific-config-files.patch
......
From: Jan Synacek <jsynacek@redhat.com>
Date: Mon, 15 Dec 2014 10:39:00 +0100
Subject: systemctl: fix argument handling when invoked as "shutdown"
(cherry picked from commit 75836b9d2071aab978ee78d7d797126a18a32052)
---
src/systemctl/systemctl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 942acbc..f4fbab5 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -6219,7 +6219,7 @@ static int shutdown_parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "HPrhkt:afFc", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "HPrhkKt:afFc", options, NULL)) >= 0) {
switch (c) {
case ARG_HELP:
@@ -6259,6 +6259,8 @@ static int shutdown_parse_argv(int argc, char *argv[]) {
case 't':
case 'a':
+ case 'f':
+ case 'F':
/* Compatibility nops */
break;
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 29 Sep 2015 22:40:05 +0200
Subject: systemctl: when reading legacy -t argument for shutdown,
don't drop following parameter
We currently completely ignore the following parameter, but we really
should not, as that is actually the time to shut down on.
(cherry picked from commit a4420f7b8ed73b05ef6f31622101e7804daef69f)
---
src/systemctl/systemctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index f4fbab5..9adef05 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -6219,7 +6219,7 @@ static int shutdown_parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "HPrhkKt:afFc", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "HPrhkKtafFc", options, NULL)) >= 0) {
switch (c) {
case ARG_HELP:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment