Skip to content

Commit

Permalink
executor: apply LogLevelMax earlier
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bluca authored and yuwata committed Dec 4, 2023
1 parent b88f0fd commit cc9f4ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/exec-invoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit cc9f4ca

Please sign in to comment.