]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: fhandler_pipe: fix permission problem
authorKen Brown <kbrown@cornell.edu>
Sat, 25 May 2019 14:27:38 +0000 (10:27 -0400)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 13 Sep 2021 15:45:53 +0000 (17:45 +0200)
commitf56206cd86b9aa02668b858fa8067d74762edc58
tree91db9744bdaafb5804b953b90c110dab6ac79027
parentd0ad52aa6eb1a47ebb76a11118b19aa70e2671f0
Cygwin: fhandler_pipe: fix permission problem

The read handles of pipes created by CreateNamedPipe don't have
FILE_WRITE_ATTRIBUTES access unless the pipe is created with
PIPE_ACCESS_DUPLEX.  This causes set_pipe_non_blocking to fail on such
handles.  To fix this, add a helper function nt_create, which uses
NtCreateNamedPipeFile instead of CreateNamedPipe and gives us more
flexibility in setting access rights.

Use this helper function in fhandler_pipe::create (fhandler_pipe *[2],
unsigned, int), which is the version of fhandler_pipe::create used by
the pipe and pipe2 system calls.

For convenience, also add a static member function
fhandler_pipe::npfs_handle similar to those used by fhandler_fifo and
fhandler_socket_unix.
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_pipe.cc
This page took 0.027768 seconds and 5 git commands to generate.