[PATCH v2 3/3] Cygwin: fstatat: support the AT_EMPTY_PATH flag

2019-12-29 Thread Ken Brown
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

[PATCH v2 2/3] Cygwin: readlinkat: allow pathname to be empty

2019-12-29 Thread Ken Brown
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

[PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2019-12-29 Thread Ken Brown
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

[PATCH v2 1/3] Cygwin: allow opening a symlink with O_PATH | O_NOFOLLOW

2019-12-29 Thread Ken Brown
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

Re: [PATCH 3/3] Cygwin: fchownat and fstatat: support the AT_EMPTY_PATH flag

2019-12-29 Thread Ken Brown
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