* syscalls.cc (open): Don't follow symlinks if O_EXCL is given.

This commit is contained in:
Corinna Vinschen 2007-08-24 14:55:56 +00:00
parent c60c72d718
commit 70650b2db4
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2007-08-24 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (open): Don't follow symlinks if O_EXCL is given.
2007-08-23 Corinna Vinschen <corinna@vinschen.de>
* ntdll.h (STATUS_NO_SUCH_FILE): Define.

View File

@ -889,8 +889,9 @@ open (const char *unix_path, int flags, ...)
if (fd >= 0)
{
if (!(fh = build_fh_name (unix_path, NULL, (flags & O_NOFOLLOW) ?
PC_SYM_NOFOLLOW : PC_SYM_FOLLOW,
if (!(fh = build_fh_name (unix_path, NULL,
(flags & (O_NOFOLLOW | O_EXCL))
? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW,
transparent_exe ? stat_suffixes : NULL)))
res = -1; // errno already set
else if ((flags & O_NOFOLLOW) && fh->issymlink ())