iliaa           Fri Oct 13 01:44:42 2006 UTC

  Modified files:              
    /php-src/ext/standard       basic_functions.c file.c 
  Log:
  MFB: Fixed bug #38934 (move_uploaded_file() cannot read uploaded file 
  outside of open_basedir).  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.815&r2=1.816&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.815 
php-src/ext/standard/basic_functions.c:1.816
--- php-src/ext/standard/basic_functions.c:1.815        Thu Oct 12 12:40:26 2006
+++ php-src/ext/standard/basic_functions.c      Fri Oct 13 01:44:42 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.815 2006/10/12 12:40:26 mike Exp $ */
+/* $Id: basic_functions.c,v 1.816 2006/10/13 01:44:42 iliaa Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -6024,8 +6024,7 @@
        VCWD_UNLINK(Z_STRVAL_PP(new_path));
        if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path)) == 0) {
                successful = 1;
-       } else
-               if (php_copy_file(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path) 
TSRMLS_CC) == SUCCESS) {
+       } else if (php_copy_file_ex(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path), 
STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
                VCWD_UNLINK(Z_STRVAL_PP(path));
                successful = 1;
        }
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.463&r2=1.464&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.463 php-src/ext/standard/file.c:1.464
--- php-src/ext/standard/file.c:1.463   Mon Oct  9 02:52:27 2006
+++ php-src/ext/standard/file.c Fri Oct 13 01:44:42 2006
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.463 2006/10/09 02:52:27 pollita Exp $ */
+/* $Id: file.c,v 1.464 2006/10/13 01:44:42 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1799,9 +1799,14 @@
 }
 /* }}} */
 
+PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
+{
+       return php_copy_file_ex(src, dest, 0 TSRMLS_CC);
+}
+
 /* {{{ php_copy_file
  */
-PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
+PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC)
 {
        php_stream *srcstream = NULL, *deststream = NULL;
        int ret = FAILURE;
@@ -1856,7 +1861,7 @@
        }
 safe_to_copy:
 
-       srcstream = php_stream_open_wrapper(src, "rb", REPORT_ERRORS, NULL);
+       srcstream = php_stream_open_wrapper(src, "rb", src_chk | REPORT_ERRORS, 
NULL);
        
        if (!srcstream) {
                return ret;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to