|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-30 12:56 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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?