From: Ilia Alshanetsky Date: Tue, 10 Feb 2004 16:09:56 +0000 (+0000) Subject: MFH: Fixed bug #26653 (open_basedir incorrectly resolved on win32). X-Git-Tag: php-4.3.5RC3~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a68c033bf9b9505d7aa7ac65eadcab6630fe039a;p=php MFH: Fixed bug #26653 (open_basedir incorrectly resolved on win32). --- diff --git a/NEWS b/NEWS index baf9fa0b2c..8fe8df30a9 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ PHP 4 NEWS the 'Status: 200' header that is not normally needed). (Ilia) - Fixed bug #26758 (FastCGI exits immediately with status 255). (Ilia, tcarter at noggin dot com dot au) +- Fixed bug #26653 (open_basedir incorrectly resolved on win32). (Ilia, + scottmacvicar at ntlworld dot com) - Fixed bug #24773 (unsetting string as array causes a crash). (Sara) 03 Feb 2004, Version 4.3.5RC2 diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 37f96c054d..ad3e4f9cc7 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -132,15 +132,15 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path 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 (basedir[strlen(basedir)-1] == PHP_DIR_SEPARATOR && resolved_basedir[resolved_basedir_len -1] != PHP_DIR_SEPARATOR) { - resolved_basedir[resolved_basedir_len] = '/'; + 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 (path[strlen(path)-1] == PHP_DIR_SEPARATOR) { resolved_name_len = strlen(resolved_name); if (resolved_name[resolved_name_len - 1] != PHP_DIR_SEPARATOR) { - resolved_name[resolved_name_len] = '/'; + resolved_name[resolved_name_len] = PHP_DIR_SEPARATOR; resolved_name[++resolved_name_len] = '\0'; } }