Commit 44d1a879 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Resolve the EXEC_ON_READ bit for ServerRoot and other modules that test
  the directive context.  Should eliminate the segfault.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95171 13f79535-47bb-0310-9956-ffa450edef68
parent b0042289
Loading
Loading
Loading
Loading
+9 −2
Changes for server/core.c: 9 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -983,12 +983,19 @@ AP_DECLARE(const char *) ap_check_cmd_context(cmd_parms *cmd,
                           " cannot occur within <Limit> section", NULL);
    }

    if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE
        && cmd->path != NULL) {
    if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) {
        if (cmd->path != NULL) {
            return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
                            " cannot occur within <Directory/Location/Files> "
                            "section", NULL);
        }
        if (cmd->cmd->req_override & EXEC_ON_READ) {
            /* EXEC_ON_READ must be NOT_IN_DIR_LOC_FILE, if not, it will
             * (deliberately) segfault below in the individual tests...
             */
            return NULL;
        }
    }
    
    if (((forbidden & NOT_IN_DIRECTORY)
         && ((found = find_parent(cmd->directive, "<Directory"))