mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-11 19:59:06 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user