Cygwin: allow opening a symlink with O_PATH | O_NOFOLLOW
Up to now, opening a symlink with O_NOFOLLOW fails with ELOOP. Following Linux, allow this to succeed if O_PATH is also specified.
This commit is contained in:
parent
85aff2830a
commit
35a1a6dbdf
@ -1470,7 +1470,7 @@ open (const char *unix_path, int flags, ...)
|
||||
|
||||
if (!(fh = build_fh_name (unix_path, opt, stat_suffixes)))
|
||||
__leave; /* errno already set */
|
||||
if ((flags & O_NOFOLLOW) && fh->issymlink ())
|
||||
if ((flags & O_NOFOLLOW) && fh->issymlink () && !(flags & O_PATH))
|
||||
{
|
||||
set_errno (ELOOP);
|
||||
__leave;
|
||||
|
Loading…
Reference in New Issue
Block a user