dgaudet 97/07/15 00:33:31
Modified: src mod_autoindex.c mod_dir.c Log: Fix problem with directory indexes if mod_autoindex is invoked before mod_dir. Essentially one of them has to tack a trailing / on r->filename. Revision Changes Path 1.36 +10 -2 apache/src/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_autoindex.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C3 -r1.35 -r1.36 *** mod_autoindex.c 1997/07/12 13:14:45 1.35 --- mod_autoindex.c 1997/07/15 07:33:29 1.36 *************** *** 861,869 **** /* OK, nothing easy. Trot out the heavy artillery... */ ! if (allow_opts & OPT_INDEXES) return index_directory (r, d); ! else { log_reason ("Directory index forbidden by rule", r->filename, r); return HTTP_FORBIDDEN; } --- 861,877 ---- /* OK, nothing easy. Trot out the heavy artillery... */ ! if (allow_opts & OPT_INDEXES) { ! /* KLUDGE --- make the sub_req lookups happen in the right directory. ! * Fixing this in the sub_req_lookup functions themselves is difficult, ! * and would probably break virtual includes... ! */ ! ! if (r->filename[strlen (r->filename) - 1] != '/') { ! r->filename = pstrcat (r->pool, r->filename, "/", NULL); ! } return index_directory (r, d); ! } else { log_reason ("Directory index forbidden by rule", r->filename, r); return HTTP_FORBIDDEN; } 1.36 +3 -1 apache/src/mod_dir.c Index: mod_dir.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_dir.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C3 -r1.35 -r1.36 *** mod_dir.c 1997/07/12 12:33:13 1.35 --- mod_dir.c 1997/07/15 07:33:29 1.36 *************** *** 125,131 **** * and would probably break virtual includes... */ ! r->filename = pstrcat (r->pool, r->filename, "/", NULL); while (*names_ptr) { --- 125,133 ---- * and would probably break virtual includes... */ ! if (r->filename[strlen (r->filename) - 1] != '/') { ! r->filename = pstrcat (r->pool, r->filename, "/", NULL); ! } while (*names_ptr) {