summaryrefslogtreecommitdiffstats
path: root/src/core/exec-invoke.c
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-12-03 19:30:07 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-12-04 03:45:22 +0100
commitcc9f4cad8cd759ab55048dc7a3eaa2c2fb0344da (patch)
treed7c45f1ff4500d4fb79d7ca445d445dd563e86c5 /src/core/exec-invoke.c
parentMerge pull request #30305 from yuwata/seccomp-fix (diff)
downloadsystemd-cc9f4cad8cd759ab55048dc7a3eaa2c2fb0344da.tar.xz
systemd-cc9f4cad8cd759ab55048dc7a3eaa2c2fb0344da.zip
executor: apply LogLevelMax earlier
SELinux logs before we have a chance to apply it, move it up as it breaks TEST-04-JOURNAL: [ 408.578624] testsuite-04.sh[11463]: ++ journalctl -b -q -u silent-success.service [ 408.578743] testsuite-04.sh[11098]: + [[ -z Dec 03 13:38:41 H systemd-executor[11459]: SELinux enabled state cached to: disabled ]] Follow-up for: bb5232b6a3b8a
Diffstat (limited to 'src/core/exec-invoke.c')
-rw-r--r--src/core/exec-invoke.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c
index a3e8b8297c..74c910fc12 100644
--- a/src/core/exec-invoke.c
+++ b/src/core/exec-invoke.c
@@ -3976,6 +3976,9 @@ int exec_invoke(
assert(params);
assert(exit_status);
+ if (context->log_level_max >= 0)
+ log_set_max_level(context->log_level_max);
+
/* Explicitly test for CVE-2021-4034 inspired invocations */
if (!command->path || strv_isempty(command->argv)) {
*exit_status = EXIT_EXEC;
@@ -4038,8 +4041,6 @@ int exec_invoke(
log_forget_fds();
log_set_open_when_needed(true);
log_settle_target();
- if (context->log_level_max >= 0)
- log_set_max_level(context->log_level_max);
/* In case anything used libc syslog(), close this here, too */
closelog();