get/setrlimit issues in inndstart

mki mki at primenet.com
Thu Jun 22 02:55:58 UTC 2000


Currently, inndstart.c sets RLIMIT_NOFILE by changing the rlim_cur member
of struct rlimit.  Wouldn't it be advisable to make it change rlim_max as
well? because, if someone specifies rlimitnofile: in inn.conf to be some
value, say 512, and the default maximum descriptor limit is 64, then 
setrlimit() fails with EINVAL, because rlim_cur is greater than rlim_max.

ie. in inndstart.c at line 95 or 96, add rl.rlim_max = n; 

--- inndstart.c.old     Wed Jun 21 19:51:48 2000
+++ inndstart.c Wed Jun 21 19:50:16 2000
@@ -93,6 +93,7 @@
         return;
     }
     rl.rlim_cur = n;
+    rl.rlim_max = n;
     if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
         syslog(L_ERROR, "can't setrlimit(NOFILE, %d): %m", n);
         return;

-mohan



More information about the inn-workers mailing list