This is the mail archive of the cygwin-patches mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi Ken, On Dec 29 17:56, 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', the file descriptor > returned by the call should be usable as the dirfd argument in calls > to fstatat and readlinkat with an empty pathname, to have > the calls operate on the symbolic link. The second and third patches > achieve this. For fstatat, we do this by adding support > for the AT_EMPTY_PATH flag. > > Note: The man page mentions fchownat and linkat also. linkat already > supports the AT_EMPTY_PATH flag, so nothing needs to be done. But I > don't understand how this could work for fchownat, because fchown > fails with EBADF if its fd argument was opened with O_PATH. So I > haven't touched fchownat. It was never supposed to work that way. We can make fchownat work with AT_EMPTY_PATH, but using it on a file opened with O_PATH contradicts the Linux open(2) man page, afaics: O_PATH (since Linux 2.6.39) Obtain a file descriptor that can be used for two purposes: to indicate a location in the filesystem tree and to perform opera‐ tions that act purely at the file descriptor level. The file itself is not opened, and other file operations (e.g., read(2), write(2), fchmod(2), fchown(2), fgetxattr(2), ioctl(2), mmap(2)) ^^^^^^^^^ fail with the error EBADF. ^^^^^^^^^ ^^^^^ That'd from the current F31 man pages. > Am I missing something? Good question. Let me ask in return, did *I* now miss something? Corinna -- Corinna Vinschen Cygwin Maintainer
Attachment:
signature.asc
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |