Received: (from majordom@localhost) by hyperreal.com (8.8.5/8.8.5) id VAA06772; Mon, 16 Jun 1997 21:43:52 -0700 (PDT) Received: from scanner.worldgate.com (scanner.worldgate.com [198.161.84.3]) by hyperreal.com (8.8.5/8.8.5) with ESMTP id VAA06704 for ; Mon, 16 Jun 1997 21:43:36 -0700 (PDT) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.8.5/8.8.5) with UUCP id WAA05059 for new-httpd@hyperreal.com; Mon, 16 Jun 1997 22:43:31 -0600 (MDT) Received: from localhost (marcs@localhost) by alive.znep.com (8.7.5/8.7.3) with SMTP id WAA25238 for ; Mon, 16 Jun 1997 22:44:42 -0600 (MDT) Date: Mon, 16 Jun 1997 22:44:42 -0600 (MDT) From: Marc Slemko To: new-httpd@hyperreal.com Subject: [PATCH] mod_include and cwd Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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): XXX 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);