You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ni...@apache.org on 2009/12/22 00:26:01 UTC
svn commit: r893027 - in /httpd/httpd/trunk: CHANGES
docs/manual/programs/httpd.xml include/http_main.h server/core.c
server/main.c
Author: niq
Date: Mon Dec 21 23:26:00 2009
New Revision: 893027
URL: http://svn.apache.org/viewvc?rev=893027&view=rev
Log:
(re)-introduce -T commandline option to suppress documentroot check at startup
PR 41887
Patch by Jan van den Berg
Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/docs/manual/programs/httpd.xml
httpd/httpd/trunk/include/http_main.h
httpd/httpd/trunk/server/core.c
httpd/httpd/trunk/server/main.c
Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=893027&r1=893026&r2=893027&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon Dec 21 23:26:00 2009
@@ -22,6 +22,10 @@
*) Core: reject NULLs in request line or request headers.
PR 43039 [Nick Kew]
+ *) 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.3.4
*) Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
Modified: httpd/httpd/trunk/docs/manual/programs/httpd.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/programs/httpd.xml?rev=893027&r1=893026&r2=893027&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/programs/httpd.xml (original)
+++ httpd/httpd/trunk/docs/manual/programs/httpd.xml Mon Dec 21 23:26:00 2009
@@ -152,6 +152,10 @@
<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
Modified: httpd/httpd/trunk/include/http_main.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_main.h?rev=893027&r1=893026&r2=893027&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_main.h (original)
+++ httpd/httpd/trunk/include/http_main.h Mon Dec 21 23:26:00 2009
@@ -33,7 +33,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" {
@@ -58,6 +58,8 @@
/** 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'
Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=893027&r1=893026&r2=893027&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Mon Dec 21 23:26:00 2009
@@ -1162,13 +1162,19 @@
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)) {
Modified: httpd/httpd/trunk/server/main.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/main.c?rev=893027&r1=893026&r2=893027&view=diff
==============================================================================
--- httpd/httpd/trunk/server/main.c (original)
+++ httpd/httpd/trunk/server/main.c Mon Dec 21 23:26:00 2009
@@ -370,7 +370,7 @@
pad);
#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:");
@@ -449,10 +449,15 @@
" -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;
@@ -612,6 +617,10 @@
configtestonly = 1;
break;
+ case 'T':
+ ap_document_root_check = 0;
+ break;
+
case 'S':
configtestonly = 1;
new = (char **)apr_array_push(ap_server_config_defines);
Re: svn commit: r893027 - in /httpd/httpd/trunk: CHANGES docs/manual/programs/httpd.xml
include/http_main.h server/core.c server/main.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
niq@apache.org wrote:
>
> URL: http://svn.apache.org/viewvc?rev=893027&view=rev
> Log:
> (re)-introduce -T commandline option to suppress documentroot check at startup
> PR 41887
This must be be conditioned on a case-sensitive filesystem; otherwise a very
loud emit should be broadcast warning that the <Directory > and other directives
may not be applied as expected, potentially creating security holes in the users
configuration.