This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH v4 0/4] Support opening a symlink with O_PATH | O_NOFOLLOW
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin-patches at cygwin dot com" <cygwin-patches at cygwin dot com>
- Date: Mon, 20 Jan 2020 14:57:29 +0000
- Subject: Re: [PATCH v4 0/4] Support opening a symlink with O_PATH | O_NOFOLLOW
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UFv5/fZ8iOVA/hrtYb5Y6BHLHS4XwXEcH4WeTEEax4o=; b=nG81Jikc6hzjKqydhn1+QFCveFziWerPvkrrvwIw9LvNYCU/RV4qlR4lq34Jap6bqVjp6rBAkDTdR8hvfV8yQmFKUY86Srx4z5oUZ3N6ID0h4g3mrJwcrPZGG709HYjaynBhxIBqmds12AwKsE8f5iokSJMTO88vmSlzFGyGbJGzi2eepA/9Hewz4C1NVbqRX8KRbCjblza1TYRygzdFsiNsFxL7NYKti6U5yORzSEvLW1hScA9YcXlzv4SEEchy9nqnsDN6Fy21rcnuL6NlHkB4alLbRZiN277vV6kOR1cX1wVelYyNRA04aBEhi1BtjLnqht4Hc1MTx6BLQEAt5A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h2aZakUZgwcYpXI1JOwl6eAukSkbQUQx1MnxnwLE6Ijt4lshY7RJtKWh9f+uZvH0sUK+4I3ZKc8g0v6InckV9Xzh9ycipu4FARCUk6z/Zvl9KGSs9+YoMAcIkGhTu/qPelbt6FmU8RGM5yrt/hvzMKjsEthZ0HR48HyHbN0qHAOC7TtU3IwN/j9UaXzRynCBmmu6ghPYsbPE1APGHYw/LzzqyaNLdszEY9Ipv/BgaW6f9pUUqc13qMf4g3ud2+0JNz8JcU96Dam6cpRemTyX/SlE1+XxBL4l9oeft2qVMtMh4k3jAU/RSIxracrcMO2sN5uyLdvn/puIKEC7MSia0w==
- References: <20200117161037.1828-1-kbrown@cornell.edu> <20200120095607.GD20672@calimero.vinschen.de>
On 1/20/2020 4:56 AM, Corinna Vinschen wrote:
> 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...
Maybe. You're in a better position to judge this than I am. If you decide to
do it, I'll tweak the documentation accordingly.
Ken