mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
autospawn: refuse autospawning if process disabled waitpid()
This commit is contained in:
parent
5e24b6dff5
commit
f6763917ee
1 changed files with 15 additions and 2 deletions
|
|
@ -668,11 +668,24 @@ static pa_strlist *prepend_per_user(pa_strlist *l) {
|
|||
static int context_autospawn(pa_context *c) {
|
||||
pid_t pid;
|
||||
int status, r;
|
||||
|
||||
pa_log_debug("Trying to autospawn...");
|
||||
struct sigaction sa;
|
||||
|
||||
pa_context_ref(c);
|
||||
|
||||
if (sigaction(SIGCHLD, NULL, &sa) < 0) {
|
||||
pa_log_debug("sigaction() failed: %s", pa_cstrerror(errno));
|
||||
pa_context_fail(c, PA_ERR_INTERNAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((sa.sa_flags & SA_NOCLDWAIT) || sa.sa_handler == SIG_IGN) {
|
||||
pa_log_debug("Process disabled waitpid(), cannot autospawn.");
|
||||
pa_context_fail(c, PA_ERR_CONNECTIONREFUSED);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
pa_log_debug("Trying to autospawn...");
|
||||
|
||||
if (c->spawn_api.prefork)
|
||||
c->spawn_api.prefork();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue