You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@hyperreal.org on 1998/10/23 22:07:40 UTC
cvs commit: apache-1.3/src/main http_core.c
coar 98/10/23 13:07:40
Modified: src CHANGES
src/main http_core.c
Log:
Fix problem with config parser not noticing if a container
start line was missing the closing '>'.
PR: 3279
Submitted by: Ryan Bloom <rb...@us.ibm.com>
Reviewed by: Ken Coar
Revision Changes Path
1.1123 +5 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1122
retrieving revision 1.1123
diff -u -r1.1122 -r1.1123
--- CHANGES 1998/10/23 19:28:51 1.1122
+++ CHANGES 1998/10/23 20:07:37 1.1123
@@ -1,5 +1,10 @@
Changes with Apache 1.3.4
+ *) The config parser wasn't correctly noticing a missing '>'
+ on container start lines (e.g., it wouldn't spot
+ "<Directory /" as a syntax error). [Ryan Bloom <rb...@us.ibm.com>]
+ PR#3279
+
*) Add a 'RemoveHandler' directive which will selectively remove
all handler associations for the specified file extensions.
[Ryan Bloom <rb...@us.ibm.com>] PR#1799.
1.237 +35 -12 apache-1.3/src/main/http_core.c
Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -r1.236 -r1.237
--- http_core.c 1998/10/23 19:06:26 1.236
+++ http_core.c 1998/10/23 20:07:39 1.237
@@ -1149,6 +1149,15 @@
return cmd->end_token;
}
+/*
+ * Report a missing-'>' syntax error.
+ */
+static char *unclosed_directive(cmd_parms *cmd)
+{
+ return ap_pstrcat(cmd->pool, cmd->cmd->name,
+ "> directive missing closing '>'", NULL);
+}
+
static const char *dirsection(cmd_parms *cmd, void *dummy, const char *arg)
{
const char *errmsg;
@@ -1167,10 +1176,12 @@
return err;
}
- if (endp) {
- *endp = '\0';
+ if (endp == NULL) {
+ return unclosed_directive(cmd);
}
+ *endp = '\0';
+
cmd->path = ap_getword_conf(cmd->pool, &arg);
#ifdef OS2
/* Fix OS/2 HPFS filename case problem. */
@@ -1238,10 +1249,12 @@
return err;
}
- if (endp) {
- *endp = '\0';
+ if (endp == NULL) {
+ return unclosed_directive(cmd);
}
+ *endp = '\0';
+
cmd->path = ap_getword_conf(cmd->pool, &arg);
cmd->override = OR_ALL|ACCESS_CONF;
@@ -1304,10 +1317,12 @@
return err;
}
- if (endp) {
- *endp = '\0';
+ if (endp == NULL) {
+ return unclosed_directive(cmd);
}
+ *endp = '\0';
+
cmd->path = ap_getword_conf(cmd->pool, &arg);
/* Only if not an .htaccess file */
if (!old_path) {
@@ -1376,9 +1391,12 @@
module *found;
int nest = 1;
- if (endp) {
- *endp = '\0';
+ if (endp == NULL) {
+ return unclosed_directive(cmd);
}
+
+ *endp = '\0';
+
if (not) {
arg++;
}
@@ -1433,9 +1451,12 @@
int nest = 1;
endp = strrchr(arg, '>');
- if (endp) {
- *endp = '\0';
+ if (endp == NULL) {
+ return unclosed_directive(cmd);
}
+
+ *endp = '\0';
+
if (arg[0] == '!') {
not = 1;
arg++;
@@ -1477,9 +1498,11 @@
return err;
}
- if (endp) {
- *endp = '\0';
+ if (endp == NULL) {
+ return unclosed_directive(cmd);
}
+
+ *endp = '\0';
/* FIXME: There's another feature waiting to happen here -- since you
can now put multiple addresses/names on a single <VirtualHost>