#42587 [Opn->Asn]: behaviour change regarding symlinked .php files

From: Date: Sun, 09 Sep 2007 10:35:43 +0000
Subject: #42587 [Opn->Asn]: behaviour change regarding symlinked .php files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-117325@lists.php.net to get a copy of this message
 ID:               42587
 Updated by:       jani@php.net
 Reported By:      christian at hoffie dot info
-Status:           Open
+Status:           Assigned
 Bug Type:         CGI related
 Operating System: Linux 2.6
 PHP Version:      5CVS-2007-09-07 (snap)
-Assigned To:      
+Assigned To:      dmitry
 New Comment:

Dmitry, you break, you fix. :)


Previous Comments:
------------------------------------------------------------------------

[2007-09-07 14:39:07] christian at hoffie dot info

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 this bug report at http://bugs.php.net/?id=42587&edit=1


Thread (3 messages)

« previous php.bugs (#117325) next »