]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #26653 (open_basedir incorrectly resolved on win32).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2004 16:09:56 +0000 (16:09 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2004 16:09:56 +0000 (16:09 +0000)
NEWS
main/fopen_wrappers.c

diff --git a/NEWS b/NEWS
index baf9fa0b2c171277f8243baecd97b6b6fcfb0b92..8fe8df30a900ad3adf3d0daaaf8beb9db2711956 100644 (file)
--- 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
index 37f96c054d1defa273262330b3d3794aae1a8acd..ad3e4f9cc72c1b194a71dba7953f1f29dc2a70d4 100644 (file)
@@ -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';
                        }
                }