Fix CVE-2011-4028: File disclosure vulnerability.
use O_NOFOLLOW to open the existing lock file, so symbolic links aren't followed, thus avoid revealing if it point to an existing file. Note that xserver on OpenBSD isn't affected by CVE-2011-4029.
This commit is contained in:
parent
6f33ccac59
commit
a05754665a
@ -337,7 +337,7 @@ LockServer(void)
|
||||
/*
|
||||
* Read the pid from the existing file
|
||||
*/
|
||||
lfd = open(LockFile, O_RDONLY);
|
||||
lfd = open(LockFile, O_RDONLY|O_NOFOLLOW);
|
||||
if (lfd < 0) {
|
||||
unlink(tmp);
|
||||
FatalError("Can't read lock file %s\n", LockFile);
|
||||
|
Loading…
Reference in New Issue
Block a user