* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Disallow attempts to set

the process group to a nonexistent process group.
This commit is contained in:
Christopher Faylor
2004-09-28 04:41:42 +00:00
parent 2b94cfce89
commit e3e443e4df
2 changed files with 6 additions and 1 deletions

View File

@ -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;