From: Todd C. Miller Date: Fri, 6 Jul 2012 14:10:23 +0000 (-0400) Subject: Do not set a resource limit to zero when we are unable to fetch a X-Git-Tag: SUDO_1_7_10~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6eb82bf19876047677e256308877999f61986ef5;p=sudo Do not set a resource limit to zero when we are unable to fetch a value from /etc/security/limits. --HG-- branch : 1.7 --- diff --git a/aix.c b/aix.c index 873896e22..eaac89426 100644 --- a/aix.c +++ b/aix.c @@ -106,9 +106,10 @@ aix_setlimits(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) {