diff options
author | cperciva <cperciva@FreeBSD.org> | 2004-07-13 13:10:07 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2004-07-13 13:10:07 +0000 |
commit | 6bbfebb2615bbd5e1e50cb13dc3d2dad83d6e799 (patch) | |
tree | 8e5ef451685682e11ab06c06919a4384978c6d9d /sys/kern/kern_fork.c | |
parent | 72619ae6d5c8cd10bc420ae669927d9e3c1221e8 (diff) | |
download | FreeBSD-src-6bbfebb2615bbd5e1e50cb13dc3d2dad83d6e799.zip FreeBSD-src-6bbfebb2615bbd5e1e50cb13dc3d2dad83d6e799.tar.gz |
Replace "uid != 0" with "suser(td->td_ucred) != 0" when checking if we've
hit the maximum number of processes. The last ten processes are reserved
for the *non-jailed* superuser.
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r-- | sys/kern/kern_fork.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 4b88795..440c39c4 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -300,7 +300,8 @@ fork1(td, flags, pages, procp) */ sx_xlock(&allproc_lock); uid = td->td_ucred->cr_ruid; - if ((nprocs >= maxproc - 10 && uid != 0) || nprocs >= maxproc) { + if ((nprocs >= maxproc - 10 && suser(td->td_ucred) != 0) || + nprocs >= maxproc) { error = EAGAIN; goto fail; } |