apache2filter bug#38904
| From: | Hannes Magnusson | Date: | Fri, 22 Sep 2006 12:21:13 +0000 |
| Subject: | apache2filter bug#38904 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-25800@lists.php.net to get a copy of this message | ||
Hi all.
Attached is a patch for bug#38904 which is caused by the fact
php_execute_script() only chdir()s if zend_file_handle type is set to
ZEND_HANDLE_FILENAME, but since the re-implementation of the
apache2filter it is set to ZEND_HANDLE_STREAM now.
The patch doesn't seem to break any of our tests or anything, but
fiddling around there scares me so I would appreciate if someone could
sanity-check it and verify that it is the-way-to-go.
-Hannes
Index: main/main.c =================================================================== RCS file: /repository/php-src/main/main.c,v retrieving revision 1.640.2.23.2.15 diff -u -r1.640.2.23.2.15 main.c --- main/main.c 18 Sep 2006 23:08:36 -0000 1.640.2.23.2.15 +++ main/main.c 22 Sep 2006 10:13:14 -0000 @@ -1704,7 +1704,8 @@ PG(during_request_startup) = 0; - if (primary_file->type == ZEND_HANDLE_FILENAME + if ((primary_file->type == ZEND_HANDLE_FILENAME || + primary_file->type == ZEND_HANDLE_STREAM) && primary_file->filename) { #if HAVE_BROKEN_GETCWD /* this looks nasty to me */
Index: main/main.c =================================================================== RCS file: /repository/php-src/main/main.c,v retrieving revision 1.640.2.23.2.15 diff -u -r1.640.2.23.2.15 main.c --- main/main.c 18 Sep 2006 23:08:36 -0000 1.640.2.23.2.15 +++ main/main.c 22 Sep 2006 10:13:14 -0000 @@ -1704,7 +1704,8 @@ PG(during_request_startup) = 0; - if (primary_file->type == ZEND_HANDLE_FILENAME + if ((primary_file->type == ZEND_HANDLE_FILENAME || + primary_file->type == ZEND_HANDLE_STREAM) && primary_file->filename) { #if HAVE_BROKEN_GETCWD /* this looks nasty to me */