patchable olducode varable
[unix-history] / usr / src / sys / kern / kern_proc.c
index 156351a..1b752ac 100644 (file)
@@ -1,4 +1,4 @@
-/*     kern_proc.c     3.12    %G%     */
+/*     kern_proc.c     3.16    %G%     */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -315,7 +315,7 @@ register struct inode *ip;
                            1 + ts/CLSIZE, (int)btoc(u.u_exdata.ux_dsize));
 
                /* THIS SHOULD BE DONE AT A LOWER LEVEL, IF AT ALL */
                            1 + ts/CLSIZE, (int)btoc(u.u_exdata.ux_dsize));
 
                /* THIS SHOULD BE DONE AT A LOWER LEVEL, IF AT ALL */
-               mtpr(TBIA,1);
+               mtpr(TBIA, 0);
 
                /*
                 * set SUID/SGID protections, if no tracing
 
                /*
                 * set SUID/SGID protections, if no tracing
@@ -467,6 +467,7 @@ exit(rv)
                plock(u.u_rdir);
                iput(u.u_rdir);
        }
                plock(u.u_rdir);
                iput(u.u_rdir);
        }
+       u.u_limit[LIM_FSIZE] = INFINITY;
        acct();
        vrelpt(u.u_procp);
        vrelu(u.u_procp, 0);
        acct();
        vrelpt(u.u_procp);
        vrelu(u.u_procp, 0);
@@ -498,7 +499,7 @@ done:
                        /*
                         * Traced processes are killed
                         * since their existence means someone is screwing up.
                        /*
                         * Traced processes are killed
                         * since their existence means someone is screwing up.
-                        * Traced processes are sent a hangup and a continue.
+                        * Stopped processes are sent a hangup and a continue.
                         * This is designed to be ``safe'' for setuid
                         * processes since they must be willing to tolerate
                         * hangups anyways.
                         * This is designed to be ``safe'' for setuid
                         * processes since they must be willing to tolerate
                         * hangups anyways.
@@ -512,7 +513,8 @@ done:
                        }
                        /*
                         * Protect this process from future
                        }
                        /*
                         * Protect this process from future
-                        * tty signals, and clear TSTP/TTIN/TTOU if pending.
+                        * tty signals, clear TSTP/TTIN/TTOU if pending,
+                        * and set SDETACH bit on procs.
                         */
                        spgrp(q, -1);
                }
                         */
                        spgrp(q, -1);
                }
@@ -683,6 +685,10 @@ sbreak()
        if (n < 0)
                n = 0;
        d = clrnd(n - u.u_dsize);
        if (n < 0)
                n = 0;
        d = clrnd(n - u.u_dsize);
+       if (u.u_dsize+d > u.u_limit[LIM_DATA]) {
+               u.u_error = ENOMEM;
+               return;
+       }
        if (chksize(u.u_tsize, u.u_dsize+d, u.u_ssize))
                return;
        if (swpexpand(u.u_dsize+d, u.u_ssize, &u.u_dmap, &u.u_smap)==0)
        if (chksize(u.u_tsize, u.u_dsize+d, u.u_ssize))
                return;
        if (swpexpand(u.u_dsize+d, u.u_ssize, &u.u_dmap, &u.u_smap)==0)