Index: main/fopen_wrappers.c =================================================================== RCS file: /repository/php-src/main/fopen_wrappers.c,v retrieving revision 1.175.2.3.2.11 diff -u -p -d -r1.175.2.3.2.11 fopen_wrappers.c --- main/fopen_wrappers.c 18 Apr 2007 11:58:40 -0000 1.175.2.3.2.11 +++ main/fopen_wrappers.c 31 May 2007 21:32:06 -0000 @@ -172,8 +172,8 @@ PHPAPI int php_check_specific_open_based } } + resolved_name_len = strlen(resolved_name); if (path_tmp[path_len - 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] = PHP_DIR_SEPARATOR; resolved_name[++resolved_name_len] = '\0'; @@ -189,6 +189,16 @@ PHPAPI int php_check_specific_open_based /* File is in the right directory */ return 0; } else { + /* /openbasedir/ and /openbasedir are the same directory */ + if (resolved_basedir_len == (resolved_name_len + 1) && resolved_basedir[resolved_basedir_len - 1] == PHP_DIR_SEPARATOR) { +#if defined(PHP_WIN32) || defined(NETWARE) + if (strncasecmp(resolved_basedir, resolved_name, resolved_name_len) == 0) { +#else + if (strncmp(resolved_basedir, resolved_name, resolved_name_len) == 0) { +#endif + return 0; + } + } return -1; } } else {