Cygwin: proc fd: return EACCES for HANDLE-less fds
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
7f60199032
commit
8ae26f96ae
@ -69,6 +69,13 @@ fhandler_process_fd::fetch_fh (HANDLE &out_hdl, uint32_t flags)
|
||||
}
|
||||
hdl = pc.deserialize (buf);
|
||||
}
|
||||
if (hdl == NULL)
|
||||
{
|
||||
if (proc != GetCurrentProcess ())
|
||||
CloseHandle (proc);
|
||||
set_errno (EACCES);
|
||||
return NULL;
|
||||
}
|
||||
BOOL ret = DuplicateHandle (proc, hdl, GetCurrentProcess (), &hdl,
|
||||
0, FALSE, DUPLICATE_SAME_ACCESS);
|
||||
if (proc != GetCurrentProcess ())
|
||||
|
Loading…
x
Reference in New Issue
Block a user