ID:               24873
 User updated by:  enrik dot berkhan at planb dot de
 Reported By:      enrik dot berkhan at planb dot de
 Status:           Bogus
 Bug Type:         PHP options/info functions
 Operating System: any
 PHP Version:      4.3.2
 New Comment:

Then it should be documented not to work. But you're right, just
letting something broken fits into the all over PHP quality ;-)

What about my comment on adding `/' instead of PHP_DIR_SEPARATOR?


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

[2003-07-30 11:09:21] [EMAIL PROTECTED]

It's not supposed to work as it's the same as leaving open_basedir
setting out altogether..


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

[2003-07-30 10:50:01] enrik dot berkhan at planb dot de

Description:
------------
if you set open_basedir = "/" it doesn't work, as it is internally
expanded to "//" in fopen_wrappers.c.

Suggested patch:

*** fopen_wrappers.c.orig       Sun Feb 23 23:03:54 2003
--- fopen_wrappers.c    Wed Jul 30 17:38:41 2003
***************
*** 131,137 ****
        /* Resolve the real path into resolved_name */
        if ((expand_filepath(path, resolved_name TSRMLS_CC) != NULL) &&
(expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) !=
NULL)) {
                /* Handler for basedirs that end with a / */
!               if (basedir[strlen(basedir)-1] == PHP_DIR_SEPARATOR) {
                        resolved_basedir_len =
strlen(resolved_basedir);
                        resolved_basedir[resolved_basedir_len] = '/';
                        resolved_basedir[++resolved_basedir_len] =
'\0';
--- 131,138 ----
        /* Resolve the real path into resolved_name */
        if ((expand_filepath(path, resolved_name TSRMLS_CC) != NULL) &&
(expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) !=
NULL)) {
                /* Handler for basedirs that end with a / */
!               if (basedir[strlen(basedir)-1] == PHP_DIR_SEPARATOR &&
!                     resolved_basedir[strlen(resolved_basedir)-1] !=
PHP_DIR_SEPARATOR) {
                        resolved_basedir_len =
strlen(resolved_basedir);
                        resolved_basedir[resolved_basedir_len] = '/';
                        resolved_basedir[++resolved_basedir_len] =
'\0';
***************
*** 139,145 ****
                        resolved_basedir_len =
strlen(resolved_basedir);
                }
                                                                       
        
!               if (path[strlen(path)-1] == PHP_DIR_SEPARATOR) {
                        resolved_name_len = strlen(resolved_name);
                        resolved_name[resolved_name_len] = '/';
                        resolved_name[++resolved_name_len] = '\0';
--- 140,147 ----
                        resolved_basedir_len =
strlen(resolved_basedir);
                }
   
!               if (path[strlen(path)-1] == PHP_DIR_SEPARATOR &&
!                     resolved_name[strlen(resolved_name)-1] !=
PHP_DIR_SEPARATOR) {
                        resolved_name_len =
strlen(resolved_naPHP_DIR_SEPARATORme);
                        resolved_name[resolved_name_len] = '/';
                        resolved_name[++resolved_name_len] = '\0';

BTW, why is a literal `/' added to the names, not PHP_DIR_SEPARATOR?



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


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

Reply via email to