mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-03-04 01:40:46 -05:00
daemon: make sure pa has its own session and process group, but is not its leader so that we cannot acquire a tty ever
This commit is contained in:
parent
2dc37e1214
commit
8e94f65348
3 changed files with 38 additions and 20 deletions
|
|
@ -2999,3 +2999,19 @@ finish:
|
|||
pa_make_fd_cloexec(fileno(f));
|
||||
return f;
|
||||
}
|
||||
|
||||
void pa_nullify_stdfds(void) {
|
||||
|
||||
#ifndef OS_IS_WIN32
|
||||
pa_close(STDIN_FILENO);
|
||||
pa_close(STDOUT_FILENO);
|
||||
pa_close(STDERR_FILENO);
|
||||
|
||||
pa_assert_se(open("/dev/null", O_RDONLY) == STDIN_FILENO);
|
||||
pa_assert_se(open("/dev/null", O_WRONLY) == STDOUT_FILENO);
|
||||
pa_assert_se(open("/dev/null", O_WRONLY) == STDERR_FILENO);
|
||||
#else
|
||||
FreeConsole();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue