mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
auth: Create cookie directory if it doesn't exist
Makes sure the cookie directory exists before trying to create the cookie. This might be the case on freshly installed headless systems.
This commit is contained in:
parent
59968f8e2c
commit
a91359956f
1 changed files with 3 additions and 0 deletions
|
|
@ -82,6 +82,9 @@ static int load(const char *fn, pa_bool_t create, void *data, size_t length) {
|
||||||
pa_assert(data);
|
pa_assert(data);
|
||||||
pa_assert(length > 0);
|
pa_assert(length > 0);
|
||||||
|
|
||||||
|
if (create)
|
||||||
|
pa_make_secure_parent_dir(fn, pa_in_system_mode() ? 0755U : 0700U, -1, -1);
|
||||||
|
|
||||||
if ((fd = pa_open_cloexec(fn, (create ? O_RDWR|O_CREAT : O_RDONLY)|O_BINARY, S_IRUSR|S_IWUSR)) < 0) {
|
if ((fd = pa_open_cloexec(fn, (create ? O_RDWR|O_CREAT : O_RDONLY)|O_BINARY, S_IRUSR|S_IWUSR)) < 0) {
|
||||||
|
|
||||||
if (!create || errno != EACCES || (fd = open(fn, O_RDONLY|O_BINARY)) < 0) {
|
if (!create || errno != EACCES || (fd = open(fn, O_RDONLY|O_BINARY)) < 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue