Skip to content

Commit cc9f4ca

Browse files
blucayuwata
authored andcommitted
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: bb5232b
1 parent b88f0fd commit cc9f4ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/exec-invoke.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3976,6 +3976,9 @@ int exec_invoke(
39763976
assert(params);
39773977
assert(exit_status);
39783978

3979+
if (context->log_level_max >= 0)
3980+
log_set_max_level(context->log_level_max);
3981+
39793982
/* Explicitly test for CVE-2021-4034 inspired invocations */
39803983
if (!command->path || strv_isempty(command->argv)) {
39813984
*exit_status = EXIT_EXEC;
@@ -4038,8 +4041,6 @@ int exec_invoke(
40384041
log_forget_fds();
40394042
log_set_open_when_needed(true);
40404043
log_settle_target();
4041-
if (context->log_level_max >= 0)
4042-
log_set_max_level(context->log_level_max);
40434044

40444045
/* In case anything used libc syslog(), close this here, too */
40454046
closelog();

0 commit comments

Comments
 (0)