summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-09-17 02:10:13 +0000
committerChristopher Faylor <me@cgf.cx>2003-09-17 02:10:13 +0000
commit11dcd1546f348b94a32fb4f8569b1991cb99d036 (patch)
tree312ddded84eff76cef524891c42b39f33712deee
parent9ee691211b3e29d9a3b69ece65b709cae6855659 (diff)
downloadcygnal-11dcd1546f348b94a32fb4f8569b1991cb99d036.tar.gz
cygnal-11dcd1546f348b94a32fb4f8569b1991cb99d036.tar.bz2
cygnal-11dcd1546f348b94a32fb4f8569b1991cb99d036.zip
* fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with
PID_MAP_RW. * sigproc.cc (talktome): Ditto for winpids.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/fhandler_process.cc3
-rw-r--r--winsup/cygwin/sigproc.cc5
3 files changed, 11 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a7ef9a7d8..2725400c3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2003-09-16 Christopher Faylor <cgf@redhat.com>
+ * fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with
+ PID_MAP_RW.
+ * sigproc.cc (talktome): Ditto for winpids.
+
+2003-09-16 Christopher Faylor <cgf@redhat.com>
+
* pinfo.h (winpids::pid_access): New element.
(winpids::winpids): Rejigger to set pinfo_access.
* pinfo.cc (winpids::add): Try to open shared memory region with
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 44b7189b3..2ba1e5326 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -245,7 +245,8 @@ out:
bool
fhandler_process::fill_filebuf ()
{
- pinfo p (pid);
+ pinfo p (pid, PID_MAP_RW); // PID_MAP_RW for cmdline since it
+ // needs to signal the other process
if (!p)
{
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index dff073049..6c5393795 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -1056,10 +1056,11 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
static void
talktome ()
{
- winpids pids;
+ winpids pids ((DWORD) PID_MAP_RW);
for (unsigned i = 0; i < pids.npids; i++)
if (pids[i]->hello_pid == myself->pid)
- pids[i]->commune_recv ();
+ if (!IsBadWritePtr (pids[i], sizeof (_pinfo)))
+ pids[i]->commune_recv ();
}
#define RC_MAIN 0