summaryrefslogtreecommitdiffstats
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-04-21 18:44:39 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-04-21 18:44:39 +0000
commit179bee57dbd36c6a1f1e2149558ce78d765733a4 (patch)
tree1e9f3deeec0951021f025b9b9bb0ac19fa20ce7c /winsup
parent27f1db48c7be1d40b320705395f36b4e395f4af1 (diff)
downloadcygnal-179bee57dbd36c6a1f1e2149558ce78d765733a4.tar.gz
cygnal-179bee57dbd36c6a1f1e2149558ce78d765733a4.tar.bz2
cygnal-179bee57dbd36c6a1f1e2149558ce78d765733a4.zip
* dtable.cc (dtable::init_std_file_from_handle): Set access mask for
the slave side of ttys explicitely. Explain why.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dtable.cc5
2 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4c2fe767c..c0f9da6d6 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * dtable.cc (dtable::init_std_file_from_handle): Set access mask for
+ the slave side of ttys explicitely. Explain why.
+
2010-04-20 Christopher Faylor <me+cygwin@cgf.cx>
* path.cc (cygwin_create_path): Free memory on error.
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 67f9b4144..7f52c9750 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -363,8 +363,9 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle)
FILE_ACCESS_INFORMATION fai;
/* Console windows are not kernel objects, so the access mask returned
- by NtQueryInformationFile is meaningless. */
- if (dev == FH_TTY || dev == FH_CONSOLE)
+ by NtQueryInformationFile is meaningless. CMD always hands down
+ stdin handles as R/O handles, but our tty slave sides are R/W. */
+ if (dev == FH_TTY || dev == FH_CONSOLE || dev.major == DEV_TTYS_MAJOR)
access |= GENERIC_READ | GENERIC_WRITE;
else if (NT_SUCCESS (NtQueryInformationFile (handle, &io, &fai,
sizeof fai,