summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2004-07-13 13:10:07 +0000
committercperciva <cperciva@FreeBSD.org>2004-07-13 13:10:07 +0000
commit6bbfebb2615bbd5e1e50cb13dc3d2dad83d6e799 (patch)
tree8e5ef451685682e11ab06c06919a4384978c6d9d /sys/kern/kern_fork.c
parent72619ae6d5c8cd10bc420ae669927d9e3c1221e8 (diff)
downloadFreeBSD-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.c3
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;
}
OpenPOWER on IntegriCloud