Project

General

Profile

Actions

Bug #2723

closed

setrlimit can increase RLIMIT_NOFILE up to rlim_max for non-root

Added by gstrauss over 8 years ago. Updated over 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

setrlimit can increase RLIMIT_NOFILE up to rlim_max for non-root

diff --git a/src/server.c b/src/server.c
index 61d850c..7aacf2e 100644
--- a/src/server.c
+++ b/src/server.c
@@ -954,9 +954,9 @@ int main (int argc, char **argv) {
                }

                /**
-                * we are not root can can't increase the fd-limit, but we can reduce it
+                * we are not root can can't increase the fd-limit above rlim_max, but we can reduce it
                 */
-               if (srv->srvconf.max_fds && srv->srvconf.max_fds < rlim.rlim_cur) {
+               if (srv->srvconf.max_fds && srv->srvconf.max_fds <= rlim.rlim_max) {
                        /* set rlimits */

                        rlim.rlim_cur = srv->srvconf.max_fds;
Actions #1

Updated by gstrauss over 8 years ago

  • Category set to core
Actions #2

Updated by gstrauss over 8 years ago

  • Status changed from Patch Pending to Fixed

committed in bb953177

Actions

Also available in: Atom