You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2010/12/04 16:06:29 UTC
svn commit: r1042198 - /httpd/httpd/trunk/os/unix/unixd.c
Author: covener
Date: Sat Dec 4 15:06:29 2010
New Revision: 1042198
URL: http://svn.apache.org/viewvc?rev=1042198&view=rev
Log:
Per the existing comment and setrlimit() behavior -- only prevent attempts to
raise the hard limit, not to lower it, by nonroot users.
Modified:
httpd/httpd/trunk/os/unix/unixd.c
Modified: httpd/httpd/trunk/os/unix/unixd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/os/unix/unixd.c?rev=1042198&r1=1042197&r2=1042198&view=diff
==============================================================================
--- httpd/httpd/trunk/os/unix/unixd.c (original)
+++ httpd/httpd/trunk/os/unix/unixd.c Sat Dec 4 15:06:29 2010
@@ -95,10 +95,13 @@ AP_DECLARE(void) ap_unixd_set_rlimit(cmd
/* 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) {