diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2011-10-17 22:26:12 +0200 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2011-10-21 20:43:19 +0200 |
commit | 3394ae378da567025ac94a2c2ff04f2a0b113962 (patch) | |
tree | c4815ff1ba9ec50200aefabdc4451060027109ce | |
parent | 656307e93a7c72b147805e3741ebb02baf876150 (diff) |
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.
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 6ba44b91e37622ef8c146d8f2ac92d708a18ed34)
(cherry picked from commit f80d23357874db19bc124dee70239fb182977883)
-rw-r--r-- | os/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/os/utils.c b/os/utils.c index d7c8388d0..7032227d8 100644 --- a/os/utils.c +++ b/os/utils.c @@ -336,7 +336,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); |