Edit report at http://bugs.php.net/bug.php?id=54726&edit=1

 ID:                 54726
 Updated by:         paj...@php.net
 Reported by:        superaap at gmail dot com
 Summary:            partial open_basedir path no longer works
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            Safe Mode/open_basedir
 Operating System:   CentOS release 5.4 (Final)
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2011-05-21 02:19:56] fel...@php.net

See bug #53577

------------------------------------------------------------------------
[2011-05-13 09:41:19] superaap at gmail dot com

Description:
------------
Our VirtualHost points to a symlink which links to the document_root of
the 

current application version.



Example directory list;

l /var/www/html/application -> /var/www/html/application-v1.2.3

d /var/www/html/application-v1.2.2

d /var/www/html/application-v1.2.3



Before v5.3 (5.2.4 I think) using the entire symlink path as
open_basedir value 

would sitll trigger 

open_basedir error's. We worked around this problem by using the partial
suffix 

'/var/www/html/app'.

This behaviour was fixed when we upgraded to v5.3.2 were the entire
symlink path 

would work as well, but we 

did not bother to update all our vhost's as both methods now worked.



But now we have upgraded to v5.3.6 the partial paths no longer work.

Warning: require_once() [function.require-once]: open_basedir
restriction in 

effect. 

File(/var/www/html/application-v1.2.3/bootstrap.php) is not within the
allowed 

path(s): (.:/var/www/html/app)



This behaviour seems to be broken since r305698 where the open_basedir
is always 

appended with a directory 

separator;

--- php/php-src/trunk/main/fopen_wrappers.c     2010/11/23 21:49:18     305697

+++ php/php-src/trunk/main/fopen_wrappers.c     2010/11/23 22:14:54     305698

@@ -233,6 +233,9 @@

                                resolved_basedir[resolved_basedir_len] = 

PHP_DIR_SEPARATOR;

                                resolved_basedir[++resolved_basedir_len] = '\0';

                        }

+               } else {

+                               resolved_basedir[resolved_basedir_len++] = 

PHP_DIR_SEPARATOR;

+                               resolved_basedir[resolved_basedir_len] = '\0';

                }

 

                resolved_name_len = strlen(resolved_name);





I don't think this change was intended because it is not listed in the 

changelog, and breaks backward 

compatibility in a minor release.





------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54726&edit=1

Reply via email to