diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-06-05 12:24:03 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-06-05 13:09:46 +0200 |
commit | a4152e3fe28b53b8919cc404dd7eca7ead1bf9bd (patch) | |
tree | 6d19cc912c50c123de8d4d599f802f83aea73b4a /src/core/socket.c | |
parent | 5331194c120520579eede9dba4bd9c3329629601 (diff) |
kdbus: when uploading bus name policy, resolve users/groups out-of-process
It's not safe invoking NSS from PID 1, hence fork off worker processes
that upload the policy into the kernel for busnames.
Diffstat (limited to 'src/core/socket.c')
-rw-r--r-- | src/core/socket.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index e834b045a0..9c4943e0bf 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -1173,11 +1173,12 @@ static void socket_unwatch_fds(Socket *s) { if (p->fd < 0) continue; - if (p->event_source) { - r = sd_event_source_set_enabled(p->event_source, SD_EVENT_OFF); - if (r < 0) - log_debug_unit(UNIT(s)->id, "Failed to disable event source."); - } + if (!p->event_source) + continue; + + r = sd_event_source_set_enabled(p->event_source, SD_EVENT_OFF); + if (r < 0) + log_debug_unit(UNIT(s)->id, "Failed to disable event source."); } } @@ -1843,6 +1844,7 @@ static int socket_start(Unit *u) { SOCKET_FINAL_SIGKILL)) return -EAGAIN; + /* Already on it! */ if (IN_SET(s->state, SOCKET_START_PRE, SOCKET_START_CHOWN, @@ -1871,8 +1873,7 @@ static int socket_start(Unit *u) { #ifdef HAVE_SYSV_COMPAT if (service->is_sysv) { - log_error_unit(u->id, - "Using SysV services for socket activation is not supported. Refusing."); + log_error_unit(u->id, "Using SysV services for socket activation is not supported. Refusing."); return -ENOENT; } #endif @@ -2282,7 +2283,7 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) { else if (code == CLD_DUMPED) f = SOCKET_FAILURE_CORE_DUMP; else - assert_not_reached("Unknown code"); + assert_not_reached("Unknown sigchld code"); if (s->control_command) { exec_status_exit(&s->control_command->exec_status, &s->exec_context, pid, code, status); |