mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
core-util: Fix permissions handling while creating directories
This makes updating of permissions on existing directories optional with pa_make_secure_dir() and pa_make_secure_parent_dir(). This makes sure that the recursive directory creation doesn't end up modifying existing directories, and also fixes a problem where creating an auth cookie (specifically ~/.esd_auth) would end up modifying permissions on ~. Thanks to Frédéric Danis for reporting this.
This commit is contained in:
parent
508ca489d2
commit
1ff604c298
5 changed files with 20 additions and 15 deletions
|
|
@ -83,7 +83,7 @@ static int load(const char *fn, pa_bool_t create, void *data, size_t length) {
|
|||
pa_assert(length > 0);
|
||||
|
||||
if (create)
|
||||
pa_make_secure_parent_dir(fn, pa_in_system_mode() ? 0755U : 0700U, -1, -1);
|
||||
pa_make_secure_parent_dir(fn, pa_in_system_mode() ? 0755U : 0700U, -1, -1, FALSE);
|
||||
|
||||
if ((fd = pa_open_cloexec(fn, (create ? O_RDWR|O_CREAT : O_RDONLY)|O_BINARY, S_IRUSR|S_IWUSR)) < 0) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue