execute: let's close glibc syslog channels too

Just in case something opened them, let's make sure glibc invalidates
them too.

Thankfully so far no library opened log channels behind our back, at
least as far as I know, hence this is actually a NOP, but let's better
be safe than sorry.
This commit is contained in:
Lennart Poettering 2017-09-26 17:52:25 +02:00
parent 12145637e9
commit 40a80078d2
1 changed files with 3 additions and 0 deletions

View File

@ -2464,6 +2464,9 @@ static int exec_child(
log_forget_fds();
log_set_open_when_needed(true);
/* In case anything used libc syslog(), close this here, too */
closelog();
n_fds = n_storage_fds + n_socket_fds;
r = close_remaining_fds(params, runtime, dcreds, user_lookup_fd, socket_fd, fds, n_fds);
if (r < 0) {