This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Cygwin: AF_UNIX: create pipes with file attribute R/W access
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 5 Mar 2018 14:19:49 -0000
- Subject: [newlib-cygwin] Cygwin: AF_UNIX: create pipes with file attribute R/W access
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=be6da79713fcfd157cf84d9efb6d4c4afd6ccf33
commit be6da79713fcfd157cf84d9efb6d4c4afd6ccf33
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Fri Mar 2 23:39:15 2018 +0100
Cygwin: AF_UNIX: create pipes with file attribute R/W access
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/fhandler_socket_unix.cc | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index e865f9e..2a43900 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -451,7 +451,9 @@ fhandler_socket_unix::create_pipe ()
ULONG max_instances;
LARGE_INTEGER timeout;
- access = GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE;
+ access = GENERIC_READ | FILE_READ_ATTRIBUTES
+ | GENERIC_WRITE | FILE_WRITE_ATTRIBUTES
+ | SYNCHRONIZE;
sharing = FILE_SHARE_READ | FILE_SHARE_WRITE;
InitializeObjectAttributes (&attr, pc.get_nt_native_path (), OBJ_INHERIT,
NULL, NULL);
@@ -484,8 +486,11 @@ fhandler_socket_unix::create_pipe_instance ()
ULONG max_instances;
LARGE_INTEGER timeout;
- access = GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE;
+ access = GENERIC_READ | FILE_READ_ATTRIBUTES
+ | GENERIC_WRITE | FILE_WRITE_ATTRIBUTES
+ | SYNCHRONIZE;
sharing = FILE_SHARE_READ | FILE_SHARE_WRITE;
+ /* NPFS doesn't understand reopening by handle, unfortunately. */
InitializeObjectAttributes (&attr, pc.get_nt_native_path (), OBJ_INHERIT,
NULL, NULL);
nonblocking = is_nonblocking () ? FILE_PIPE_COMPLETE_OPERATION