Do not set a resource limit to zero when we are unable to fetch a

value from /etc/security/limits.
This commit is contained in:
Todd C. Miller
2012-07-06 10:10:03 -04:00
parent 5904f7ede9
commit 9c9cf9da41

View File

@@ -108,8 +108,9 @@ 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)
/* 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. */