mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
daemon: Don't rely on prctl(PR_SET_KEEPCAPS, 0) for dropping caps.
Capability dropping when changing the user in the system mode was previously implemented by calling prctl(PR_SET_KEEPCAPS, 0), but that doesn't necessarily work. It's possible that the KEEPCAPS flag is locked to 1, in which case the prctl() call fails with EPERM (this happens at least on Harmattan). This patch implements explicit capability dropping after changing the user.
This commit is contained in:
parent
7e6e3b7044
commit
6db3af6601
3 changed files with 18 additions and 15 deletions
|
|
@ -251,6 +251,8 @@ static int change_user(void) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
pa_drop_caps();
|
||||
|
||||
pa_set_env("USER", PA_SYSTEM_USER);
|
||||
pa_set_env("USERNAME", PA_SYSTEM_USER);
|
||||
pa_set_env("LOGNAME", PA_SYSTEM_USER);
|
||||
|
|
@ -266,7 +268,7 @@ static int change_user(void) {
|
|||
if (!getenv("PULSE_STATE_PATH"))
|
||||
pa_set_env("PULSE_STATE_PATH", PA_SYSTEM_STATE_PATH);
|
||||
|
||||
pa_log_info(_("Successfully dropped root privileges."));
|
||||
pa_log_info(_("Successfully changed user to \"" PA_SYSTEM_USER "\"."));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue