Commit f44d1012 authored by Eric Covener's avatar Eric Covener
Browse files

improve (but preserve searchable parts of) the error message when Options

-Indexes is about to trigger a 403 in mod_autoindex, with a pointer
to mod_dir about how the DirectoryIndex might have been the real culprit.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147339 13f79535-47bb-0310-9956-ffa450edef68
parent 90c82e33
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2308,9 +2308,14 @@ static int handle_autoindex(request_rec *r)
        return index_directory(r, d);
    }
    else {
        const char *index_names = apr_table_get(r->notes, "dir-index-names");

        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Directory index forbidden by "
                      "Options directive: %s", r->filename);
                      "Cannot serve directory %s: No matching DirectoryIndex (%s) found, and "
                      "server-generated directory index forbidden by "
                      "Options directive", 
                       r->filename,
                       index_names ? index_names : "none");
        return HTTP_FORBIDDEN;
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -346,6 +346,12 @@ static int fixup_dir(request_rec *r)
        return error_notfound;
    }

    /* record what we tried, mostly for the benefit of mod_autoindex */
    apr_table_set(r->notes, "dir-index-names", 
                  d->index_names ? 
                  apr_array_pstrcat(r->pool, d->index_names, ','): 
                  AP_DEFAULT_INDEX);

    /* nothing for us to do, pass on through */
    return DECLINED;
}