Cygwin: proc fd: pass along open mode when reopening file
The reopen code neglected to pass along the requested open mode correctly. This may end up reopening the file with incorrect access mask, or duplicating the wrong pipe handle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -1507,7 +1507,7 @@ open (const char *unix_path, int flags, ...)
|
||||
if (fh->dev () == FH_PROCESSFD && fh->pc.follow_fd_symlink ())
|
||||
{
|
||||
/* Reopen file by descriptor */
|
||||
fh_file = fh->fd_reopen (flags);
|
||||
fh_file = fh->fd_reopen (flags, mode & 07777);
|
||||
if (!fh_file)
|
||||
__leave;
|
||||
delete fh;
|
||||
|
Reference in New Issue
Block a user