1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 18:13:00 +02:00

Fix open_basedir tests when running from /tmp

If our cwd is in /tmp, these tests would fail. Use a directory
name that is less likely to clash.
This commit is contained in:
Nikita Popov
2021-05-19 09:58:03 +02:00
parent 7bc8f2c83f
commit 976dd997de
2 changed files with 4 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
--INI--
open_basedir="{TMP}"
open_basedir="/some_directory_we_are_hopefully_not_running_tests_from"
--FILE--
<?php
$a=glob("./*.jpeg");

View File

@@ -6,7 +6,8 @@ Test glob() function: ensure no platform difference, variation 3
<?php
$path = __DIR__;
ini_set('open_basedir', '/tmp');
$open_basedir = '/some_directory_we_are_hopefully_not_running_tests_from';
ini_set('open_basedir', $open_basedir);
var_dump(glob("$path/*.none"));
var_dump(glob("$path/?.none"));
@@ -15,7 +16,7 @@ var_dump(glob("$path/*/nothere"));
var_dump(glob("$path/[aoeu]*.none"));
var_dump(glob("$path/directly_not_exists"));
var_dump('/tmp' == ini_get('open_basedir'));
var_dump($open_basedir == ini_get('open_basedir'));
?>
--EXPECT--
bool(false)