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:
Lennart Poettering 2007-09-23 19:30:56 +00:00
parent 2860685269
commit fc00eaf1d4

View file

@ -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;
} }