Do not accept requests from dead processes.
This commit is contained in:
parent
e1f43abc09
commit
aa994b48ee
@ -81,6 +81,9 @@ PUBLIC void main()
|
||||
if (call_nr < 0 || call_nr >= NCALLS) {
|
||||
error = ENOSYS;
|
||||
printf("FS, warning illegal %d system call by %d\n", call_nr, who);
|
||||
} else if (fp->fp_pid == PID_FREE) {
|
||||
error = ENOSYS;
|
||||
printf("FS, bad process, who = %d\n", who);
|
||||
} else {
|
||||
error = (*call_vec[call_nr])();
|
||||
}
|
||||
|
@ -350,9 +350,15 @@ PUBLIC int do_exit()
|
||||
/* If a session leader exits then revoke access to its controlling tty from
|
||||
* all other processes using it.
|
||||
*/
|
||||
if (!fp->fp_sesldr) return(OK); /* not a session leader */
|
||||
if (!fp->fp_sesldr) {
|
||||
fp->fp_pid = PID_FREE;
|
||||
return(OK); /* not a session leader */
|
||||
}
|
||||
fp->fp_sesldr = FALSE;
|
||||
if (fp->fp_tty == 0) return(OK); /* no controlling tty */
|
||||
if (fp->fp_tty == 0) {
|
||||
fp->fp_pid = PID_FREE;
|
||||
return(OK); /* no controlling tty */
|
||||
}
|
||||
dev = fp->fp_tty;
|
||||
|
||||
for (rfp = &fproc[0]; rfp < &fproc[NR_PROCS]; rfp++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user