1--TEST--
2Test open_basedir configuration
3--SKIPIF--
4<?php
5if(PHP_OS_FAMILY !== "Windows") {
6    die('skip Windows only variation');
7}
8?>
9--INI--
10open_basedir=.
11--FILE--
12<?php
13require_once "open_basedir.inc";
14$initdir = getcwd();
15test_open_basedir_before("mkdir");
16
17var_dump(mkdir("../bad/blah"));
18var_dump(mkdir("../blah"));
19var_dump(mkdir("../bad/./blah"));
20var_dump(mkdir("./.././blah"));
21
22var_dump(mkdir($initdir."/test/ok/blah"));
23var_dump(rmdir($initdir."/test/ok/blah"));
24test_open_basedir_after("mkdir");
25?>
26--CLEAN--
27<?php
28require_once "open_basedir.inc";
29delete_directories();
30?>
31--EXPECTF--
32*** Testing open_basedir configuration [mkdir] ***
33bool(true)
34bool(true)
35bool(true)
36bool(true)
37bool(true)
38
39Warning: mkdir(): open_basedir restriction in effect. File(../bad/blah) is not within the allowed path(s): (.) in %s on line %d
40bool(false)
41
42Warning: mkdir(): open_basedir restriction in effect. File(../blah) is not within the allowed path(s): (.) in %s on line %d
43bool(false)
44
45Warning: mkdir(): open_basedir restriction in effect. File(../bad/./blah) is not within the allowed path(s): (.) in %s on line %d
46bool(false)
47
48Warning: mkdir(): open_basedir restriction in effect. File(./.././blah) is not within the allowed path(s): (.) in %s on line %d
49bool(false)
50bool(true)
51bool(true)
52*** Finished testing open_basedir configuration [mkdir] ***
53