raise the hard limit, not to lower it, by nonroot users.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1042198 13f79535-47bb-0310-9956-
ffa450edef68
/* if we aren't running as root, cannot increase max */
if (geteuid()) {
limit->rlim_cur = cur;
- if (max) {
+ if (max && (max > limit->rlim_max)) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, cmd->server,
"Must be uid 0 to raise maximum %s", cmd->cmd->name);
}
+ else if (max) {
+ limit->rlim_max = max;
+ }
}
else {
if (cur) {