On 12/28/2019 2:52 PM, Ken Brown wrote:
> Following Linux, allow the pathname argument to be empty if the
> AT_EMPTY_PATH is specified. In this case the dirfd argument can refer
> to any type of file, not just a directory, and the call operates on
> that file. In particular, dirfd can refer to a
Up to now, opening a symlink with O_NOFOLLOW fails with ELOOP.
Following Linux, allow this to succeed if O_PATH is also specified.
---
winsup/cygwin/syscalls.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 20126ce10
Following Linux, allow the pathname argument to be an empty string,
provided the dirfd argument refers to a symlink opened with O_PATH and
O_NOFOLLOW. The readlinkat call then operates on that symlink.
---
winsup/cygwin/syscalls.cc | 19 +--
1 file changed, 17 insertions(+), 2 del
Currently, opening a symlink with O_NOFOLLOW fails with ELOOP.
Following Linux, the first patch in this series allows the call to
succeed if O_PATH is also specified.
According to the Linux man page for 'open', the file descriptor
returned by the call should be usable as the dirfd argument in call
Following Linux, allow the pathname argument to be empty if the
AT_EMPTY_PATH is specified. In this case the dirfd argument can refer
to any type of file, not just a directory, and the call operates on
that file. In particular, dirfd can refer to a symlink that was
opened with O_PATH and O_NOFOLL