svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/file.c branches/PHP_5_3/ext/standard/tests/file/bug52624.phpt
branches/PHP_5_4/NEWS branches/PHP_5_4/ext/standard/file.c branches/PHP_5_4/ext/standard/tests/file/bug52624.phpt trunk/ext/standard/file.c
trunk/ext/standard/tests/file/bug52624.phpt
| From: | Felipe Pena | Date: | Tue, 15 Nov 2011 16:59:59 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/file.c branches/PHP_5_3/ext/standard/tests/file/bug52624.phpt branches/PHP_5_4/NEWS branches/PHP_5_4/ext/standard/file.c branches/PHP_5_4/ext/standard/tests/file/bug52624.phpt trunk/ext/standard/file.c trunk/ext/standard/tests/file/bug52624.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-66994@lists.php.net to get a copy of this message | ||
felipe Tue, 15 Nov 2011 16:59:59 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=319255
Log:
- Fixed bug #52624 (tempnam() by-pass open_basedir with inexistent directory)
Bug: https://bugs.php.net/52624 (Open) tempnam() in SAFE
Mode
Changed paths:
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/ext/standard/file.c
A php/php-src/branches/PHP_5_3/ext/standard/tests/file/bug52624.phpt
U php/php-src/branches/PHP_5_4/NEWS
U php/php-src/branches/PHP_5_4/ext/standard/file.c
A php/php-src/branches/PHP_5_4/ext/standard/tests/file/bug52624.phpt
U php/php-src/trunk/ext/standard/file.c
A php/php-src/trunk/ext/standard/tests/file/bug52624.phpt
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2011-11-15 15:16:20 UTC (rev 319254)
+++ php/php-src/branches/PHP_5_3/NEWS 2011-11-15 16:59:59 UTC (rev 319255)
@@ -2,6 +2,10 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2011, PHP 5.3.9
+- Core:
+ . Fixed bug #52624 (tempnam() by-pass open_basedir with inexistent directory).
+ (Felipe)
+
- PHP-FPM SAPI:
. Fixed bug #60179 (php_flag and php_value does not work properly). (fat)
Modified: php/php-src/branches/PHP_5_3/ext/standard/file.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/file.c 2011-11-15 15:16:20 UTC (rev 319254)
+++ php/php-src/branches/PHP_5_3/ext/standard/file.c 2011-11-15 16:59:59 UTC (rev 319255)
@@ -876,7 +876,7 @@
RETVAL_FALSE;
- if ((fd = php_open_temporary_fd(dir, p, &opened_path TSRMLS_CC)) >= 0) {
+ if ((fd = php_open_temporary_fd_ex(dir, p, &opened_path, 1 TSRMLS_CC)) >= 0) {
close(fd);
RETVAL_STRING(opened_path, 0);
}
Added: php/php-src/branches/PHP_5_3/ext/standard/tests/file/bug52624.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/file/bug52624.phpt (rev
0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/file/bug52624.phpt 2011-11-15 16:59:59 UTC (rev
319255)
@@ -0,0 +1,12 @@
+--TEST--
+Bug #52624 (tempnam() by-pass open_basedir with inexistent directory)
+--INI--
+open_basedir=.
+--FILE--
+<?php
+
+echo tempnam("directory_that_not_exists", "prefix_");
+
+?>
+--EXPECTF--
+Warning: tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed
path(s): (%s) in %s on line %d
Modified: php/php-src/branches/PHP_5_4/NEWS
===================================================================
--- php/php-src/branches/PHP_5_4/NEWS 2011-11-15 15:16:20 UTC (rev 319254)
+++ php/php-src/branches/PHP_5_4/NEWS 2011-11-15 16:59:59 UTC (rev 319255)
@@ -5,6 +5,8 @@
- Core:
. Fixed bug #60227 (header() cannot detect the multi-line header with
CR(0x0D)). (rui)
+ . Fixed bug #52624 (tempnam() by-pass open_basedir with inexistent directory).
+ (Felipe)
- OpenSSL:
. Fixed bug #60279 (Fixed NULL pointer dereference in
Modified: php/php-src/branches/PHP_5_4/ext/standard/file.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/file.c 2011-11-15 15:16:20 UTC (rev 319254)
+++ php/php-src/branches/PHP_5_4/ext/standard/file.c 2011-11-15 16:59:59 UTC (rev 319255)
@@ -819,7 +819,7 @@
RETVAL_FALSE;
- if ((fd = php_open_temporary_fd(dir, p, &opened_path TSRMLS_CC)) >= 0) {
+ if ((fd = php_open_temporary_fd_ex(dir, p, &opened_path, 1 TSRMLS_CC)) >= 0) {
close(fd);
RETVAL_STRING(opened_path, 0);
}
Added: php/php-src/branches/PHP_5_4/ext/standard/tests/file/bug52624.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/tests/file/bug52624.phpt (rev
0)
+++ php/php-src/branches/PHP_5_4/ext/standard/tests/file/bug52624.phpt 2011-11-15 16:59:59 UTC (rev
319255)
@@ -0,0 +1,12 @@
+--TEST--
+Bug #52624 (tempnam() by-pass open_basedir with inexistent directory)
+--INI--
+open_basedir=.
+--FILE--
+<?php
+
+echo tempnam("directory_that_not_exists", "prefix_");
+
+?>
+--EXPECTF--
+Warning: tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed
path(s): (%s) in %s on line %d
Modified: php/php-src/trunk/ext/standard/file.c
===================================================================
--- php/php-src/trunk/ext/standard/file.c 2011-11-15 15:16:20 UTC (rev 319254)
+++ php/php-src/trunk/ext/standard/file.c 2011-11-15 16:59:59 UTC (rev 319255)
@@ -819,7 +819,7 @@
RETVAL_FALSE;
- if ((fd = php_open_temporary_fd(dir, p, &opened_path TSRMLS_CC)) >= 0) {
+ if ((fd = php_open_temporary_fd_ex(dir, p, &opened_path, 1 TSRMLS_CC)) >= 0) {
close(fd);
RETVAL_STRING(opened_path, 0);
}
Added: php/php-src/trunk/ext/standard/tests/file/bug52624.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/file/bug52624.phpt (rev 0)
+++ php/php-src/trunk/ext/standard/tests/file/bug52624.phpt 2011-11-15 16:59:59 UTC (rev 319255)
@@ -0,0 +1,12 @@
+--TEST--
+Bug #52624 (tempnam() by-pass open_basedir with inexistent directory)
+--INI--
+open_basedir=.
+--FILE--
+<?php
+
+echo tempnam("directory_that_not_exists", "prefix_");
+
+?>
+--EXPECTF--
+Warning: tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed
path(s): (%s) in %s on line %d