diff options
Diffstat (limited to 'src/firejail/pulseaudio.c')
-rw-r--r-- | src/firejail/pulseaudio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/firejail/pulseaudio.c b/src/firejail/pulseaudio.c index 29f3bc4f0..8bf8d8303 100644 --- a/src/firejail/pulseaudio.c +++ b/src/firejail/pulseaudio.c | |||
@@ -93,8 +93,8 @@ void pulseaudio_init(void) { | |||
93 | 93 | ||
94 | // create the new user pulseaudio directory | 94 | // create the new user pulseaudio directory |
95 | fs_build_mnt_dir(); | 95 | fs_build_mnt_dir(); |
96 | int rv = mkdir(RUN_PULSE_DIR, S_IRWXU | S_IRWXG | S_IRWXO); | 96 | int rv = mkdir(RUN_PULSE_DIR, 0700); |
97 | (void) rv; // in --chroot mode the directory canalready be there | 97 | (void) rv; // in --chroot mode the directory can already be there |
98 | if (chown(RUN_PULSE_DIR, getuid(), getgid()) < 0) | 98 | if (chown(RUN_PULSE_DIR, getuid(), getgid()) < 0) |
99 | errExit("chown"); | 99 | errExit("chown"); |
100 | if (chmod(RUN_PULSE_DIR, 0700) < 0) | 100 | if (chmod(RUN_PULSE_DIR, 0700) < 0) |
@@ -104,6 +104,10 @@ void pulseaudio_init(void) { | |||
104 | char *pulsecfg = NULL; | 104 | char *pulsecfg = NULL; |
105 | if (asprintf(&pulsecfg, "%s/client.conf", RUN_PULSE_DIR) == -1) | 105 | if (asprintf(&pulsecfg, "%s/client.conf", RUN_PULSE_DIR) == -1) |
106 | errExit("asprintf"); | 106 | errExit("asprintf"); |
107 | if (is_link("/etc/pulse/client.conf")) { | ||
108 | fprintf(stderr, "Error: invalid /etc/pulse/client.conf file\n"); | ||
109 | exit(1); | ||
110 | } | ||
107 | if (copy_file("/etc/pulse/client.conf", pulsecfg)) | 111 | if (copy_file("/etc/pulse/client.conf", pulsecfg)) |
108 | errExit("copy_file"); | 112 | errExit("copy_file"); |
109 | FILE *fp = fopen(pulsecfg, "a+"); | 113 | FILE *fp = fopen(pulsecfg, "a+"); |