diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-19 15:43:43 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-29 10:34:41 +0900 |
commit | 6339d3e6021f31a8a8907c2613f1aaac279fe745 (patch) | |
tree | 73dc4a1337afb23e17cee4cca1b1c84582ed75cf /src/shutdown | |
parent | ef9c12b157a50d63e8a8eb710c013d16c2cea319 (diff) | |
download | systemd-6339d3e6021f31a8a8907c2613f1aaac279fe745.tar.gz |
proc-cmdline: filter PID1 arguments when we are running in a container
Otherwise, PID1 arguments e.g. "--deserialize 16" may be parsed
unexpectedly by generators.
Fixes the issue reported at
https://github.com/systemd/systemd/issues/24452#issuecomment-1475004433.
Diffstat (limited to 'src/shutdown')
-rw-r--r-- | src/shutdown/shutdown.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index 5dee1b3a92..a8248901ce 100644 --- a/src/shutdown/shutdown.c +++ b/src/shutdown/shutdown.c @@ -25,6 +25,7 @@ #include "exec-util.h" #include "fd-util.h" #include "fileio.h" +#include "getopt-defs.h" #include "initrd-util.h" #include "killall.h" #include "log.h" @@ -50,23 +51,13 @@ static usec_t arg_timeout = DEFAULT_TIMEOUT_USEC; static int parse_argv(int argc, char *argv[]) { enum { - ARG_LOG_LEVEL = 0x100, - ARG_LOG_TARGET, - ARG_LOG_COLOR, - ARG_LOG_LOCATION, - ARG_LOG_TIME, - ARG_EXIT_CODE, - ARG_TIMEOUT, + COMMON_GETOPT_ARGS, + SHUTDOWN_GETOPT_ARGS, }; static const struct option options[] = { - { "log-level", required_argument, NULL, ARG_LOG_LEVEL }, - { "log-target", required_argument, NULL, ARG_LOG_TARGET }, - { "log-color", optional_argument, NULL, ARG_LOG_COLOR }, - { "log-location", optional_argument, NULL, ARG_LOG_LOCATION }, - { "log-time", optional_argument, NULL, ARG_LOG_TIME }, - { "exit-code", required_argument, NULL, ARG_EXIT_CODE }, - { "timeout", required_argument, NULL, ARG_TIMEOUT }, + COMMON_GETOPT_OPTIONS, + SHUTDOWN_GETOPT_OPTIONS, {} }; |