httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <>
Subject [PATCH] More checks for command context in http_core
Date Fri, 07 Nov 1997 16:39:19 GMT
I've added a new command context checking function to make context checks in
configuration file parsing more uniform. Before you give a +1 please re-check
if the individual tests for command context are correct.

The common check routine
    check_cmd_context(cmd, NOT_IN_VIRTUALHOST | NOT_IN_DIR_LOC_FILE | NOT_IN_LIMIT);
checks the command context against the (contextually supplied) constraints.
If the command is invoked in an invalid context, then an appropriate error
string is returned.

So, e.g.,

+    const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
+    if (err != NULL) return err;

will replace the older tests
-    if (cmd->path) return "<Directory> sections don't nest";
-    if (cmd->limited != -1) return "Can't have <Directory> within <Limit>";

NB: I also made the missing_endsection() routine simpler: it now gets the
cmd-> pointer and therefore _knows_ about the current command name.

NB2: Many context errors weren't caught before. The ServerPath directive
for instance should not be allowed in <Location> or <Files> context,

| S I E M E N S |  <>  |      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

View raw message