]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
backport from trunk r1033519:
authorJeff Trawick <trawick@apache.org>
Mon, 14 Feb 2011 20:18:20 +0000 (20:18 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 14 Feb 2011 20:18:20 +0000 (20:18 +0000)
*) suEXEC: Add Suexec directive to disable suEXEC without renaming the
   binary (Suexec Off), or force startup failure if suEXEC is required
   but not supported (Suexec On).

Submitted by: trawick
Reviewed by: covener, wrowe

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1070639 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
docs/manual/mod/core.xml
docs/manual/mod/mod_suexec.xml
os/unix/unixd.c
os/unix/unixd.h
server/core.c

diff --git a/CHANGES b/CHANGES
index 39fd0d9d87677f010db16645624a5e8a9cddef1b..488182d7892601aeccbc1faf2a3f315e80cbc4e7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.18
 
+  *) suEXEC: Add Suexec directive to disable suEXEC without renaming the
+     binary (Suexec Off), or force startup failure if suEXEC is required
+     but not supported (Suexec On).  [Jeff Trawick]
   *) mod_proxy: Put the worker in error state if the SSL handshake with the
      backend fails. PR 50332.
      [Daniel Ruggeri <DRuggeri primary.net>, Ruediger Pluem]
diff --git a/STATUS b/STATUS
index bb8af7606dfde420b4570ea90025c1bef926ad78..03ab2ed414a93a4a5c2f72b63398e7ac7077681d 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -90,18 +90,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * suEXEC: Add Suexec directive to disable suEXEC without renaming the
-     binary (Suexec Off), or force startup failure if suEXEC is required
-     but not supported (Suexec On).
-     Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1033519
-     Simpler 2.2.x patch: http://people.apache.org/~trawick/suexec-2.2.txt
-       (unlike trunk, a) doesn't cause startup to fail if SuexecUserGroup
-       coded but suEXEC disabled, and b) doesn't add field to unixd structure
-       with reason string for why suEXEC is disabled)
-     Plz consider where doc for directive should go.  Patch has it in core, as
-     enabling/disabling the basic capability is not split out into mod_unixd 2.2.x.
-     +1: trawick, covener, wrowe
-
   * mod_authn_file: Log friendly error message if AuthUserFile is not set.
       Trunk version of patch:
          http://svn.apache.org/viewcvs.cgi?rev=1070096&view=rev
index ae02ef0b3352eaf759f4a362f914fdb05efab9d8..8a4946168f8d8e7641a8553041aaf38ab6a208f7 100644 (file)
@@ -3256,6 +3256,23 @@ server</description>
 <seealso><a href="../filter.html">Filters</a> documentation</seealso>
 </directivesynopsis>
 
+<directivesynopsis>
+<name>Suexec</name>
+<description>Enable or disable the suEXEC feature</description>
+<syntax>Suexec On|Off</syntax>
+<default>On if suexec binary exists with proper owner and mode,
+Off otherwise</default>
+<contextlist><context>server config</context></contextlist>
+<compatibility>Available in Apache httpd 2.2.18 and later</compatibility>
+
+<usage>
+    <p>When On, startup will fail if the suexec binary doesn't exist
+    or has an invalid owner or file mode.</p>
+    <p>When Off, suEXEC will be disabled even if the suexec binary exists
+    and has a valid owner and file mode.</p>
+</usage>
+</directivesynopsis>
+
 <directivesynopsis>
 <name>TimeOut</name>
 <description>Amount of time the server will wait for
index a941f080718eaa8e9fd994b2995de336f15ea98d..f101b2af9d4166f9f42a25924eb9aeac3a1c7525 100644 (file)
@@ -63,7 +63,7 @@ later.</compatibility>
     </example>
 
 </usage>
-
+<seealso><directive module="core">Suexec</directive></seealso>
 </directivesynopsis>
 </modulesynopsis>
 
index 7a306be667b2fbf89052ab2b9f137029e66b4e13..85d5a98ba63edaaa2b66c0357ed42be7ce6af7d3 100644 (file)
@@ -237,6 +237,23 @@ AP_DECLARE(const char *) unixd_set_chroot_dir(cmd_parms *cmd, void *dummy,
     return NULL;
 }
 
+AP_DECLARE(const char *) unixd_set_suexec(cmd_parms *cmd, void *dummy,
+                                          int arg)
+{
+    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+    if (err != NULL) {
+        return err;
+    }
+
+    if (!unixd_config.suexec_enabled && arg) {
+        return "suEXEC isn't supported; check existence, owner, and "
+               "file mode of " SUEXEC_BIN;
+    }
+
+    unixd_config.suexec_enabled = arg;
+    return NULL;
+}
+
 AP_DECLARE(void) unixd_pre_config(apr_pool_t *ptemp)
 {
     apr_finfo_t wrapper;
index 833cc8f0c40a206f3450da162610341c06cc3916..0da52784e72e342098c3d719aa49b206511b5cfc 100644 (file)
@@ -90,6 +90,9 @@ AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
                            const char *arg, const char * arg2, int type);
 #endif
 
+AP_DECLARE(const char *) unixd_set_suexec(cmd_parms *cmd, void *dummy, 
+                                          int arg);
+
 /**
  * One of the functions to set mutex permissions should be called in
  * the parent process on platforms that switch identity when the 
index a1f3c9e2dcc2881d22887048af8be594c9f69431..4d0056b74cb5a0e17cb0af7538902d3a6f292788 100644 (file)
@@ -3483,6 +3483,10 @@ AP_INIT_TAKE1("EnableExceptionHook", ap_mpm_set_exception_hook, NULL, RSRC_CONF,
 #endif
 AP_INIT_TAKE1("TraceEnable", set_trace_enable, NULL, RSRC_CONF,
               "'on' (default), 'off' or 'extended' to trace request body content"),
+#ifdef SUEXEC_BIN
+AP_INIT_FLAG("Suexec", unixd_set_suexec, NULL, RSRC_CONF,
+             "Enable or disable suEXEC support"),
+#endif
 { NULL }
 };