]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r893027 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 10 Aug 2010 19:10:19 +0000 (19:10 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 10 Aug 2010 19:10:19 +0000 (19:10 +0000)
(re)-introduce -T commandline option to suppress documentroot check at startup
PR 41887
Patch by Jan van den Berg

Submitted by: niq
Reviewed/backported by: jim

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

CHANGES
STATUS
docs/manual/programs/httpd.xml
include/http_main.h
server/core.c
server/main.c

diff --git a/CHANGES b/CHANGES
index 3aad360abe4603432379c2a3a9ca5eb280c97d22..c2062a20474eb3278a81d47f01bea5e45f649e62 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.17
 
+  *) core: (re)-introduce -T commandline option to suppress documentroot
+     check at startup.
+     PR 41887 [Jan van den Berg <janvdberg gmail.com>]
+
 Changes with Apache 2.2.16
 
   *) SECURITY: CVE-2010-1452 (cve.mitre.org)
diff --git a/STATUS b/STATUS
index d46b459f4985ee5eab3e8464300c44b2e00d269b..bc22ad049ddb260e19e17f8223575ce2ba021d11 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -87,13 +87,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * core: (re)-introduce -T commandline option to suppress documentroot
-     check at startup
-     PR 41887
-     Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=893027
-     2.2 patch: trunk patch Works with offset.
-     +1: niq, rpluem, jim
-
    * VHosts: fix parsing of pure-numeric hostname.
      PR 44979
      Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=832172
index 598421eec25d290b9b84f0cb4b3b0dcee0268c52..bfdd582d24a48a33bdd54508ec982aacabc61333 100644 (file)
@@ -152,6 +152,10 @@ places where the directive is valid.</dd>
 <dd>Show the settings as parsed from the config file (currently only
 shows the virtualhost settings).</dd>
 
+<dt><code>-T</code></dt>
+
+<dd>Skip document root check at startup/restart.</dd>
+
 <dt><code>-t</code></dt>
 
 <dd>Run syntax tests for configuration files only.  The program
index d70e0d293726aa3705694ec968686c52f6d999b1..15e32b55aa4b590c817755f4f13fd24b1743b4f6 100644 (file)
@@ -32,7 +32,7 @@
  * in apr_getopt() format.  Use this for default'ing args that the MPM
  * can safely ignore and pass on from its rewrite_args() handler.
  */
-#define AP_SERVER_BASEARGS "C:c:D:d:E:e:f:vVlLtSMh?X"
+#define AP_SERVER_BASEARGS "C:c:D:d:E:e:f:vVlLtTSMh?X"
 
 #ifdef __cplusplus
 extern "C" {
@@ -53,6 +53,8 @@ AP_DECLARE_DATA extern apr_array_header_t *ap_server_post_read_config;
 /** An array of all -D defines on the command line.  This allows people to
  *  effect the server based on command line options */
 AP_DECLARE_DATA extern apr_array_header_t *ap_server_config_defines;
+/** Available integer for using the -T switch */
+AP_DECLARE_DATA extern int ap_document_root_check;
 
 /**
  * An optional function to send signal to server on presence of '-k'
index ab43719779d5b4e31def57b3d57dfbbc12a2b2fd..d7081fd1a764152cf5d9a95208ef680b49a1cf97 100644 (file)
@@ -1183,13 +1183,19 @@ static const char *set_document_root(cmd_parms *cmd, void *dummy,
         return err;
     }
 
+    /* When ap_document_root_check is false; skip all the stuff below */
+    if (!ap_document_root_check) {
+       conf->ap_document_root = arg;
+       return NULL;
+    }
+
     /* Make it absolute, relative to ServerRoot */
     arg = ap_server_root_relative(cmd->pool, arg);
     if (arg == NULL) {
         return "DocumentRoot must be a directory";
     }
 
-    /* TODO: ap_configtestonly && ap_docrootcheck && */
+    /* TODO: ap_configtestonly */
     if (apr_filepath_merge((char**)&conf->ap_document_root, NULL, arg,
                            APR_FILEPATH_TRUENAME, cmd->pool) != APR_SUCCESS
         || !ap_is_directory(cmd->pool, arg)) {
index 24a54d3fbf48db15f5768b1bbec8ad5e7ef03e10..384423d9490b91b78f614e1c1e2baf197217d25d 100644 (file)
@@ -361,7 +361,7 @@ static void usage(process_rec *process)
 #endif /* AP_MPM_WANT_SET_GRACEFUL_SHUTDOWN */
 #endif
     ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
-                 "       %s [-v] [-V] [-h] [-l] [-L] [-t] [-S]", pad);
+                 "       %s [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]", pad);
     ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
                  "Options:");
 
@@ -440,10 +440,15 @@ static void usage(process_rec *process)
                  "  -M                 : a synonym for -t -D DUMP_MODULES");
     ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
                  "  -t                 : run syntax check for config files");
+    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
+                "  -T                 : start without DocumentRoot(s) check");
 
     destroy_and_exit_process(process, 1);
 }
 
+/* Set ap_document_root_check to default value: true */
+AP_DECLARE_DATA int ap_document_root_check = 1;
+
 int main(int argc, const char * const argv[])
 {
     char c;
@@ -592,6 +597,10 @@ int main(int argc, const char * const argv[])
             configtestonly = 1;
             break;
 
+       case 'T':
+           ap_document_root_check = 0;
+           break;
+
         case 'S':
             configtestonly = 1;
             new = (char **)apr_array_push(ap_server_config_defines);