#42587 [NEW]: behaviour change regarding symlinked .php files
| From: | christian at hoffie dot info | Date: | Fri, 07 Sep 2007 14:39:07 +0000 |
| Subject: | #42587 [NEW]: behaviour change regarding symlinked .php files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-117282@lists.php.net to get a copy of this message | ||
From: christian at hoffie dot info
Operating system: Linux 2.6
PHP version: 5CVS-2007-09-07 (snap)
PHP Bug Type: CGI related
Bug description: behaviour change regarding symlinked .php files
Description:
------------
php-5.2.4 changed the behaviour for the current working directory (cwd)
which php scripts see when the requested php file is a symlink which points
to a php file in another directory.
It is still reproducible with php5.2-200709071230 (snapshot). php-5.2.3
worked fine. Reverting this commit [1] solves the problem.
I'm using the tarballs from php.net, no patches.
This change breaks certain Typo3 setups.
[1]
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.42&r2=1.267.2.15.2.43&pathrev=PHP_5_2
(Fixed bug #40419 (Trailing Slash in CGI request don't work))
Reproduce code:
---------------
(a web server, lighttpd in this case, is set up at 127.0.0.1:8000;
foo.php5.2.3 is handled by php5.2.3, foo.php5.2.5dev by
php5.2-200709071230; both binaries have the -n option passed; docroot is
/var/tmp/php)
christian@tux /var/tmp/php $ mkdir foo
christian@tux /var/tmp/php $ echo '<?php print getcwd(); ?>' >
foo/bar.php
christian@tux /var/tmp/php $ ln -s foo/bar.php bar.php5.2.3
christian@tux /var/tmp/php $ ln -s foo/bar.php bar.php5.2.5dev
christian@tux /var/tmp/php $ curl http://localhost:8000/bar.php5.2.5dev
/var/tmp/php/foo
christian@tux /var/tmp/php $ curl http://localhost:8000/bar.php5.2.3
/var/tmp/php
Expected result:
----------------
>=php-5.2.4 should behave exactly as <php-5.2.4; above commands should
show "/var/tmp/php" (= the directory of the symlink; not the directory of
the target of the symlink).
Actual result:
--------------
getcwd() returns /var/tmp/php/foo -- the directory which contains the
target of the requested symlink.
--
Edit bug report at http://bugs.php.net/?id=42587&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42587&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42587&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42587&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42587&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42587&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42587&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42587&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42587&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42587&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42587&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42587&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42587&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42587&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42587&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42587&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42587&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42587&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42587&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42587&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42587&r=mysqlcfg