iliaa Mon Mar 15 19:32:10 2004 EDT Modified files: (Branch: PHP_4_3) /php-src NEWS /php-src/main fopen_wrappers.c Log: MFH: Fixed bug #27559 (Corrected open_basedir resolving logic). http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.598&r2=1.1247.2.599&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.598 php-src/NEWS:1.1247.2.599 --- php-src/NEWS:1.1247.2.598 Mon Mar 15 16:26:59 2004 +++ php-src/NEWS Mon Mar 15 19:32:09 2004 @@ -11,6 +11,7 @@ - Fixed bug #27590 (crash during shutdown when freeing persistent resources in ZTS mode). (Ilia) - Fixed bug #27582 (possible crashes in imagefilltoborder()). (Pierre) +- Fixed bug #27559 (Corrected open_basedir resolving logic). (Ilia) - Fixed bug #27530 (broken http auth when safe_mode is on and PCRE is disabled). (Ilia) - Fixed bug #27509 (broken getaddrinfo() causes fsockopen() error). (Sara) http://cvs.php.net/diff.php/php-src/main/fopen_wrappers.c?r1=1.153.2.8&r2=1.153.2.9&ty=u Index: php-src/main/fopen_wrappers.c diff -u php-src/main/fopen_wrappers.c:1.153.2.8 php-src/main/fopen_wrappers.c:1.153.2.9 --- php-src/main/fopen_wrappers.c:1.153.2.8 Tue Feb 10 11:09:56 2004 +++ php-src/main/fopen_wrappers.c Mon Mar 15 19:32:09 2004 @@ -16,7 +16,7 @@ | Jim Winstead <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.153.2.8 2004/02/10 16:09:56 iliaa Exp $ */ +/* $Id: fopen_wrappers.c,v 1.153.2.9 2004/03/16 00:32:09 iliaa Exp $ */ /* {{{ includes */ @@ -132,11 +132,13 @@ 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 / */ resolved_basedir_len = strlen(resolved_basedir); - if (resolved_basedir[resolved_basedir_len -1] != PHP_DIR_SEPARATOR) { - resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR; - resolved_basedir[++resolved_basedir_len] = '\0'; + if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) { + if (resolved_basedir[resolved_basedir_len - 1] == '/') { + resolved_basedir[resolved_basedir_len - 1] = PHP_DIR_SEPARATOR; + resolved_basedir[++resolved_basedir_len] = '\0'; + } } - + if (path[strlen(path)-1] == PHP_DIR_SEPARATOR) { resolved_name_len = strlen(resolved_name); if (resolved_name[resolved_name_len - 1] != PHP_DIR_SEPARATOR) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php