httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1042198 - /httpd/httpd/trunk/os/unix/unixd.c
Date Sat, 04 Dec 2010 15:06:29 GMT
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) {



Mime
View raw message