]> granicus.if.org Git - sudo/commitdiff
Fix the default nofiles and stack hard limits.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 7 Jan 2019 16:38:03 +0000 (09:38 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 7 Jan 2019 16:38:03 +0000 (09:38 -0700)
The table of default hard limits in /etc/security/limits was out
of date with respect to the current documentation.  The default
hard limit for nofiles should be unlimited, not 8196.  The default
hard limit for stack should be 4194304 blocks (which fits in an
unsigned long on 32-bit platforms).

lib/util/aix.c

index a8bbff19dca2c03eaf0304c9b1b22e0e041cbce4..137de231b6e9e7474c3086424db7fcd5bd41401e 100644 (file)
@@ -112,21 +112,14 @@ aix_setlimits(char *user)
                continue;
            rlim.rlim_cur = val == -1 ? RLIM64_INFINITY : (rlim64_t)val * aix_limits[n].factor;
 
-           /* Set hard limit as per table in /etc/security/limits. */
+           /* Set default hard limit as per limits(4). */
            switch (aix_limits[n].resource) {
                case RLIMIT_CPU:
                case RLIMIT_FSIZE:
                    rlim.rlim_max = rlim.rlim_cur;
                    break;
                case RLIMIT_STACK:
-#ifdef HAVE_SETRLIMIT64
-                   rlim.rlim_max = 8388608ULL * aix_limits[n].factor;
-#else
-                   rlim.rlim_max = RLIM_SAVED_MAX;
-#endif
-                   break;
-               case RLIMIT_NOFILE:
-                   rlim.rlim_max = 8196 * aix_limits[n].factor;
+                   rlim.rlim_max = 4194304UL * aix_limits[n].factor;
                    break;
                default:
                    rlim.rlim_max = RLIM64_INFINITY;