[PATCH v4 0/4] Support opening a symlink with O_PATH | O_NOFOLLOW

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jan 20 09:56:00 GMT 2020


On Jan 17 16:10, Ken Brown wrote:
> 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(2), "the call returns a file
> descriptor referring to the symbolic link.  This file descriptor can
> be used as the dirfd argument in calls to fchownat(2), fstatat(2),
> linkat(2), and readlinkat(2) with an empty pathname to have the calls
> operate on the symbolic link."
> 
> The second patch achieves this for readlinkat.  The third patch does
> this for fstatat and fchownat by adding support for the AT_EMPTY_PATH
> flag.  Nothing needs to be done for linkat, which already supports the
> AT_EMPTY_PATH flag.
> 
> 
> Ken Brown (4):
>   Cygwin: allow opening a symlink with O_PATH | O_NOFOLLOW
>   Cygwin: readlinkat: allow pathname to be empty
>   Cygwin: fstatat, fchownat: support the AT_EMPTY_PATH flag
>   Cygwin: document recent changes
> 
>  winsup/cygwin/release/3.1.3 | 19 +++++++++--
>  winsup/cygwin/syscalls.cc   | 68 ++++++++++++++++++++++++++++++++-----
>  winsup/doc/new-features.xml | 19 +++++++++++
>  3 files changed, 94 insertions(+), 12 deletions(-)

This looks good to me.  Please push.  I just wonder if this isn't
new feature enough to bump the Cygwin version to 3.2...


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20200120/bab4a0aa/attachment.sig>


More information about the Cygwin-patches mailing list