httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <Martin.Krae...@mch.sni.de>
Subject !* STOP 1.3b5 *! Error in Config Parsing found
Date Thu, 19 Feb 1998 20:38:50 GMT
Hi,
Please try apache-1.3b5 with the following config file:
--snip--
<DirectoryMatch one two three>
</DirectoryMatch>
--snip--

I was expecting:
Syntax error on line 2 of /home/martin/pgtm0035/apachen/src/error.conf:
Multiple <DirectoryMatch> arguments not (yet) supported.

Instead I got:
</DirectoryMatch>

The reason seems to lie in one of the recent changes to http_core.c:
the cmd->info value is checked _after_ the srm_command_loop() call,
but this call modifies *cmd and thus cd->info is the info of
a different directive.

Wait for a final patch from me, it looks similar to the following lines,
repeated for <Files> and <Location> sections:

    Martin

@@ -965,6 +964,7 @@
     void *new_dir_conf = create_per_dir_config (cmd->pool);
     regex_t *r = NULL;
     const char *old_end_token;
+    const command_rec *thiscmd = cmd->cmd;
 
     const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
     if (err != NULL) return err;
@@ -978,7 +978,7 @@
 #endif    
     cmd->override = OR_ALL|ACCESS_CONF;
 
-    if (cmd->info) { /* <DirectoryMatch> */
+    if (thiscmd->cmd_data) { /* <DirectoryMatch> */
 	r = pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
     }
     else if (!strcmp(cmd->path, "~")) {
@@ -991,13 +991,13 @@
     }
 
     old_end_token = cmd->end_token;
-    cmd->end_token = cmd->info ? end_directorymatch_section : end_directory_section;
+    cmd->end_token = thiscmd->cmd_data ? end_directorymatch_section : end_directory_section;
     errmsg = srm_command_loop (cmd, new_dir_conf);
     if (errmsg == NULL) {
 	errmsg = missing_endsection(cmd, 1);
     }
     cmd->end_token = old_end_token;
-    if (errmsg != (cmd->info ? end_directorymatch_section : end_directory_section))
+    if (errmsg != (thiscmd->cmd_data ? end_directorymatch_section : end_directory_section))
 	return errmsg;
 
     conf = (core_dir_config *)get_module_config(new_dir_conf, &core_module);
@@ -1006,7 +1006,7 @@
     add_per_dir_conf (cmd->server, new_dir_conf);
 
     if (*arg != '\0')
-	return pstrcat (cmd->pool, "Multiple <", (cmd->info) ? "DirectoryMatch" : "Directory",
+	return pstrcat (cmd->pool, "Multiple ", thiscmd->name,
 			"> arguments not (yet) supported.", NULL);
 
     cmd->path = old_path;
--
| S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Mime
View raw message