Do not accept requests from dead processes.

This commit is contained in:
Philip Homburg 2005-07-27 12:01:11 +00:00
parent e1f43abc09
commit aa994b48ee
2 changed files with 11 additions and 2 deletions

View File

@ -81,6 +81,9 @@ PUBLIC void main()
if (call_nr < 0 || call_nr >= NCALLS) { if (call_nr < 0 || call_nr >= NCALLS) {
error = ENOSYS; error = ENOSYS;
printf("FS, warning illegal %d system call by %d\n", call_nr, who); 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 { } else {
error = (*call_vec[call_nr])(); error = (*call_vec[call_nr])();
} }

View File

@ -350,9 +350,15 @@ PUBLIC int do_exit()
/* If a session leader exits then revoke access to its controlling tty from /* If a session leader exits then revoke access to its controlling tty from
* all other processes using it. * 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; 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; dev = fp->fp_tty;
for (rfp = &fproc[0]; rfp < &fproc[NR_PROCS]; rfp++) { for (rfp = &fproc[0]; rfp < &fproc[NR_PROCS]; rfp++) {