Re: [PATCH v2 4/5] Cygwin: AF_LOCAL: fix fcntl and dup if O_PATH is set

2020-01-29 Thread Corinna Vinschen
On Jan 29 17:22, Ken Brown wrote: > For fcntl this requires a new method, fhandler_socket_local::fcntl, > which calls fhandler_base::fcntl if O_PATH is set and > fhandler_socket_wsock::fcntl otherwise. The patchset looks great. Please apply with just a minor change: Can you please add a hint why

Re: [PATCH v2 0/5] Support opening an AF_LOCAL socket with O_PATH

2020-01-29 Thread Ken Brown
On 1/29/2020 12:22 PM, Ken Brown wrote: > I'll follow up with the program I used to test this patch series. Attached. $ gcc -Wall -o o_path_socket_test o_path_socket_test.c $ ./o_path_socket_test.exe The following calls should fail with EBADF: read: OK write: OK fchmod: OK fchown: OK ioctl: OK f

[PATCH v2 4/5] Cygwin: AF_LOCAL: fix fcntl and dup if O_PATH is set

2020-01-29 Thread Ken Brown
For fcntl this requires a new method, fhandler_socket_local::fcntl, which calls fhandler_base::fcntl if O_PATH is set and fhandler_socket_wsock::fcntl otherwise. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_socket_local.cc | 12 2 files changed, 13 inserti

[PATCH v2 5/5] Cygwin: document recent changes

2020-01-29 Thread Ken Brown
--- winsup/cygwin/release/3.1.3 | 2 ++ winsup/doc/new-features.xml | 6 ++ 2 files changed, 8 insertions(+) diff --git a/winsup/cygwin/release/3.1.3 b/winsup/cygwin/release/3.1.3 index f8752ad56..06ed1eb57 100644 --- a/winsup/cygwin/release/3.1.3 +++ b/winsup/cygwin/release/3.1.3 @@ -11,6 +1

[PATCH v2 3/5] Cygwin: AF_LOCAL::fstatvfs: use our handle if O_PATH is set

2020-01-29 Thread Ken Brown
If O_PATH is set, then the fhandler_socket_local object has a handle that can be used for getting the statvfs information. Use it by calling fhandler_base::fstatvfs_by_handle. Without this change, fhandler_disk_file::fstatfvs would called on a new fhandler_disk object, which would then have to be

[PATCH v2 2/5] Cygwin: AF_LOCAL: set appropriate errno on system calls

2020-01-29 Thread Ken Brown
If an AF_LOCAL socket is opened with O_PATH, all socket system calls that take a file descriptor argument fail on the resulting descriptor. Make sure that errno is set as on Linux for those calls that are implemented on Linux. In almost all cases it is ENOTSOCK. There are two exceptions: - socka

[PATCH v2 1/5] Cygwin: AF_LOCAL: allow opening with the O_PATH flag

2020-01-29 Thread Ken Brown
If that flag is not set, or if an attempt is made to open a different type of socket, the errno is now EOPNOTSUPP instead of ENXIO. This is consistent with POSIX, starting with the 2016 edition. Earlier editions were silent on this issue. Opening is done in a (new) fhandler_socket_local::open me

[PATCH v2 0/5] Support opening an AF_LOCAL socket with O_PATH

2020-01-29 Thread Ken Brown
I'll follow up with the program I used to test this patch series. Ken Brown (5): Cygwin: AF_LOCAL: allow opening with the O_PATH flag Cygwin: AF_LOCAL: set appropriate errno on system calls Cygwin: AF_LOCAL::fstatvfs: use our handle if O_PATH is set Cygwin: AF_LOCAL: fix fcntl and dup if O

Re: [PATCH 0/3] Some O_PATH fixes

2020-01-29 Thread Ken Brown
On 1/29/2020 9:22 AM, Corinna Vinschen wrote: > On Jan 29 10:52, Corinna Vinschen wrote: >> On Jan 29 03:08, Ken Brown wrote: >>> On 1/28/2020 3:48 PM, Ken Brown wrote: On 1/28/2020 2:01 PM, Ken Brown wrote: > On 1/28/2020 12:06 PM, Corinna Vinschen wrote: >> As outlined on IRC, I foun

Re: [PATCH 0/3] Some O_PATH fixes

2020-01-29 Thread Corinna Vinschen
On Jan 29 10:52, Corinna Vinschen wrote: > On Jan 29 03:08, Ken Brown wrote: > > On 1/28/2020 3:48 PM, Ken Brown wrote: > > > On 1/28/2020 2:01 PM, Ken Brown wrote: > > >> On 1/28/2020 12:06 PM, Corinna Vinschen wrote: > > >>> As outlined on IRC, I found a problem with the ACLs created on new > > >

Re: [PATCH 0/3] Some O_PATH fixes

2020-01-29 Thread Corinna Vinschen
On Jan 29 03:08, Ken Brown wrote: > On 1/28/2020 3:48 PM, Ken Brown wrote: > > On 1/28/2020 2:01 PM, Ken Brown wrote: > >> On 1/28/2020 12:06 PM, Corinna Vinschen wrote: > >>> On Jan 27 13:21, Ken Brown wrote: > Ken Brown (3): > Cygwin: fhandler_base::fstat_fs: accomodate the O_PATH