From: Christopher Faylor Date: Tue, 28 Sep 2004 04:41:42 +0000 (+0000) Subject: * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Disallow attempts to set X-Git-Tag: gdb_6_3-20041019-branchpoint~53 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=e3e443e4df7faa1de17ed4b472ecf6d3068f86d1;p=newlib-cygwin.git * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Disallow attempts to set the process group to a nonexistent process group. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 75e461930..c0b6fe8ad 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2004-09-28 Christopher Faylor + + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Disallow attempts + to set the process group to a nonexistent process group. + 2004-09-27 Corinna Vinschen * lib/_cygwin_crt0_common.cc: Revert patch from 2004-09-16. Brakes diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index ecef3b8a9..4f1ce3e07 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -67,7 +67,7 @@ fhandler_termios::tcsetpgrp (const pid_t pgid) { termios_printf ("tty %d pgid %d, sid %d, tsid %d", tc->ntty, pgid, myself->sid, tc->getsid ()); - if (myself->sid != tc->getsid ()) + if (!pid_exists (pgid) || myself->sid != tc->getsid ()) { set_errno (EPERM); return -1;