From d82b3e319a8a45d61c8bb78bbe9d496dbbcc18b2 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Tue, 20 Feb 2001 23:34:16 +0000 Subject: Ensure that RLIMIT_NPROC limits are at least 1 to avoid bad interaction with chgproccnt. MFC candiate. Reviewed by: alfred --- sys/kern/kern_resource.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/kern/kern_resource.c') diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 1feea8b64cf8..73ffb03db9f0 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -506,6 +506,10 @@ dosetrlimit(p, which, limp) limp->rlim_cur = maxprocperuid; if (limp->rlim_max > maxprocperuid) limp->rlim_max = maxprocperuid; + if (limp->rlim_cur < 1) + limp->rlim_cur = 1; + if (limp->rlim_max < 1) + limp->rlim_max = 1; break; } *alimp = *limp; -- cgit v1.2.3