mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-01-02 11:08:39 -05:00
make sure ~/.pulse exists before we create the runtime dir link beneath it
This commit is contained in:
parent
d68c2c9f43
commit
6188737021
1 changed files with 8 additions and 3 deletions
|
|
@ -1370,6 +1370,7 @@ static int make_random_dir_and_link(mode_t m, const char *k) {
|
||||||
char *pa_get_runtime_dir(void) {
|
char *pa_get_runtime_dir(void) {
|
||||||
char *d, *k = NULL, *p = NULL, *t = NULL, *mid;
|
char *d, *k = NULL, *p = NULL, *t = NULL, *mid;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
mode_t m;
|
||||||
|
|
||||||
/* The runtime directory shall contain dynamic data that needs NOT
|
/* The runtime directory shall contain dynamic data that needs NOT
|
||||||
* to be kept accross reboots and is usuallly private to the user,
|
* to be kept accross reboots and is usuallly private to the user,
|
||||||
|
|
@ -1378,10 +1379,9 @@ char *pa_get_runtime_dir(void) {
|
||||||
* this directory, we link it to a random subdir in /tmp, if it
|
* this directory, we link it to a random subdir in /tmp, if it
|
||||||
* was not explicitly configured. */
|
* was not explicitly configured. */
|
||||||
|
|
||||||
if ((d = getenv("PULSE_RUNTIME_PATH"))) {
|
m = pa_in_system_mode() ? 0755U : 0700U;
|
||||||
mode_t m;
|
|
||||||
|
|
||||||
m = pa_in_system_mode() ? 0755U : 0700U;
|
if ((d = getenv("PULSE_RUNTIME_PATH"))) {
|
||||||
|
|
||||||
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
|
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
|
||||||
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
|
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
|
||||||
|
|
@ -1394,6 +1394,11 @@ char *pa_get_runtime_dir(void) {
|
||||||
if (!(d = get_pulse_home()))
|
if (!(d = get_pulse_home()))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
|
||||||
|
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(mid = pa_machine_id())) {
|
if (!(mid = pa_machine_id())) {
|
||||||
pa_xfree(d);
|
pa_xfree(d);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue