]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #32937 (open_basedir looses trailing / in the limiter).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 27 Sep 2005 15:08:43 +0000 (15:08 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 27 Sep 2005 15:08:43 +0000 (15:08 +0000)
NEWS
main/fopen_wrappers.c

diff --git a/NEWS b/NEWS
index fbb4bcd689a57ace5c06107e4ead580509259619..2a1a7ef3407a4cd6931b7295bdc6590c9895b09c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ PHP 4                                                                      NEWS
   (Ilia)
 - Fixed bug #33940 (array_map() fails to pass by reference when called
   recursively). (Dmitry)
+- Fixed bug #32937 (open_basedir looses trailing / in the limiter). (Adam C.)
 - Fixed bug #33690 (Crash setting some ini directives in httpd.conf). (Rasmus)
 - Fixed bug #33673 (Added detection for partially uploaded files). (Ilia)
 - Fixed bug #33648 (Using --with-regex=system causes compile failure). (Andrei)
index e4790d4557345db3df862112554750d924086585..627c3e557ffb4fe3abdf5db8c540b14f4cc32ed2 100644 (file)
@@ -110,8 +110,8 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
                /* Handler for basedirs that end with a / */
                resolved_basedir_len = strlen(resolved_basedir);
                if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) {
-                       if (resolved_basedir[resolved_basedir_len - 1] == '/') {
-                               resolved_basedir[resolved_basedir_len - 1] = PHP_DIR_SEPARATOR;
+                       if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) {
+                               resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR;
                                resolved_basedir[++resolved_basedir_len] = '\0';
                        }
                }