From 9c9cf9da41c523b508fa3f34b1c7e16ee1931435 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 6 Jul 2012 10:10:03 -0400 Subject: [PATCH] Do not set a resource limit to zero when we are unable to fetch a value from /etc/security/limits. --- common/aix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/aix.c b/common/aix.c index bd20b2672..2af2694f9 100644 --- a/common/aix.c +++ b/common/aix.c @@ -108,9 +108,10 @@ aix_setlimits(char *user) else rlim.rlim_cur = rlim.rlim_max; /* soft not specd, use hard */ } else { - /* No hard limit set, try soft limit. */ - if (aix_getlimit(user, aix_limits[n].soft, &val) == 0) - rlim.rlim_cur = val == -1 ? RLIM64_INFINITY : val * aix_limits[n].factor; + /* No hard limit set, try soft limit, if it exists. */ + if (aix_getlimit(user, aix_limits[n].soft, &val) == -1) + continue; + rlim.rlim_cur = val == -1 ? RLIM64_INFINITY : val * aix_limits[n].factor; /* Set hard limit per AIX /etc/security/limits documentation. */ switch (aix_limits[n].resource) { -- 2.40.0