mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
use O_NOFOLLOW when creating lock files, too
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1892 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
2860685269
commit
fc00eaf1d4
1 changed files with 41 additions and 38 deletions
|
|
@ -943,7 +943,11 @@ int pa_lock_lockfile(const char *fn) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if ((fd = open(fn, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR)) < 0) {
|
if ((fd = open(fn, O_CREAT|O_RDWR|O_NOCTTY
|
||||||
|
#ifdef O_NOFOLLOW
|
||||||
|
|O_NOFOLLOW
|
||||||
|
#endif
|
||||||
|
, S_IRUSR|S_IWUSR)) < 0) {
|
||||||
pa_log_warn("Failed to create lock file '%s': %s", fn, pa_cstrerror(errno));
|
pa_log_warn("Failed to create lock file '%s': %s", fn, pa_cstrerror(errno));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
@ -1462,4 +1466,3 @@ void pa_close_pipe(int fds[2]) {
|
||||||
|
|
||||||
fds[0] = fds[1] = -1;
|
fds[0] = fds[1] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue