]> granicus.if.org Git - php/commitdiff
- MFB: add test cases for #41655
authorPierre Joye <pajoye@php.net>
Fri, 22 Jun 2007 12:35:41 +0000 (12:35 +0000)
committerPierre Joye <pajoye@php.net>
Fri, 22 Jun 2007 12:35:41 +0000 (12:35 +0000)
ext/standard/tests/file/bug41655_1.phpt [new file with mode: 0644]
ext/standard/tests/file/bug41655_2.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/file/bug41655_1.phpt b/ext/standard/tests/file/bug41655_1.phpt
new file mode 100644 (file)
index 0000000..9b047bc
--- /dev/null
@@ -0,0 +1,10 @@
+--TEST--
+Bug #41655: open_basedir bypass via glob()
+--INI--
+open_basedir=/tmp
+--FILE--
+<?php
+       $a=glob("./*.jpeg");
+?>
+--EXPECTF--
+Warning: glob() [%s]: open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp) in %s on line %d
diff --git a/ext/standard/tests/file/bug41655_2.phpt b/ext/standard/tests/file/bug41655_2.phpt
new file mode 100644 (file)
index 0000000..a675d59
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Bug #41655: open_basedir bypass via glob()
+--INI--
+open_basedir=/
+--FILE--
+<?php
+       $dir = dirname(__FILE__);
+       $a=glob($dir . "/bug41655*.*");
+       print_r($a);
+?>
+--EXPECTF--
+Array
+(
+    [%d] => %sbug41655_1.phpt
+    [%d] => %sbug41655_2.phpt
+)