]> Zhao Yanbai Git Server - minix.git/commitdiff
Do not accept requests from dead processes.
authorPhilip Homburg <philip@cs.vu.nl>
Wed, 27 Jul 2005 12:01:11 +0000 (12:01 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Wed, 27 Jul 2005 12:01:11 +0000 (12:01 +0000)
servers/fs/main.c
servers/fs/misc.c

index d3403a73035654d98a1c4310506ac2d7adbb045d..988a25a767e8708ea2db695283ce6cd5958fbbeb 100644 (file)
@@ -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])();
                }
index b340278807c68eb822b261ce4287eda86a6ebafe..0167b2a892e92448d0a8393ad9aa79fc3f1c47e1 100644 (file)
@@ -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++) {