diff options
author | truckman <truckman@FreeBSD.org> | 2000-09-14 23:07:39 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2000-09-14 23:07:39 +0000 |
commit | 48aa25a6f65fca2b6b8f868f95c262cc0cc99b73 (patch) | |
tree | 6a108e6efd572c4054b2625e4da85f64a6fd70f0 /sys/kern | |
parent | 5bb6e489c0ab09d343ec5ad57a5aa96d9974a6f6 (diff) | |
download | FreeBSD-src-48aa25a6f65fca2b6b8f868f95c262cc0cc99b73.zip FreeBSD-src-48aa25a6f65fca2b6b8f868f95c262cc0cc99b73.tar.gz |
Enforce process limit policy in one place to keep proccnt from diverging
from reality.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_fork.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 0aa31ab..c3699b2 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -253,8 +253,8 @@ fork1(p1, flags, procp) * a nonprivileged user to exceed their current limit. */ ok = chgproccnt(p1->p_cred->p_uidinfo, 1, - p1->p_rlimit[RLIMIT_NPROC].rlim_cur); - if (uid != 0 && !ok) { + (uid != 0) ? p1->p_rlimit[RLIMIT_NPROC].rlim_cur : 0); + if (!ok) { /* * Back out the process count */ |