You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/06/17 06:44:42 UTC
[PATCH] mod_include and cwd
I think this was introduced when we got rid of the getwd() from
mod_include.c. I think the below is the easiest way of fixing it.
Can be demonstrated with the following SSI (/~marcs/inc/t.html):
<!--#include virtual="/~marcs/incl.html" -->
XXX
<!--#exec cmd="/bin/sh -c pwd"-->
XXX
where /~marcs/incl.html is also parsed by mod_include. Without the patch,
pwd gives gives ~marcs/public_html/ instead of ~marcs/public_html/inc/.
I think this is the only place the cwd is messed with in mod_include.
See PR#742. So wonderfully rare to see a PR that is about a bug that I
almost wept in joy...
Index: mod_include.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_include.c,v
retrieving revision 1.34
diff -c -r1.34 mod_include.c
*** mod_include.c 1997/06/15 19:22:29 1.34
--- mod_include.c 1997/06/17 04:36:28
***************
*** 524,529 ****
--- 524,530 ----
}
destroy_sub_req (rr);
+ chdir_file(r->filename);
return 0;
}
***************
*** 571,576 ****
--- 572,578 ----
if (!error_fmt && run_sub_req (rr))
error_fmt = "unable to include %s in parsed file %s";
+ chdir_file(r->filename);
if (error_fmt) {
log_printf(r->server, error_fmt, tag_val, r->filename);