PHP  
 PHP_5_4
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Expected Test Failure Report for tests/security/open_basedir_linkinfo.phpt ('Test open_basedir configuration')

Script

1: <?php
2: chdir
(__DIR__);
3:
ini_set("open_basedir"".");
4: require_once 
"open_basedir.inc";
5:
$initdir getcwd();
6:
test_open_basedir_before("linkinfo"FALSE);
7:
8:
chdir($initdir);
9:
10:
$target = ($initdir."/test/bad/bad.txt");
11:
$symlink = ($initdir."/test/ok/symlink.txt");
12:
var_dump(symlink($target$symlink));
13:
14:
chdir($initdir."/test/ok");
15:
16:
var_dump(linkinfo("symlink.txt"));
17:
var_dump(linkinfo("../ok/symlink.txt"));
18:
var_dump(linkinfo("../ok/./symlink.txt"));
19:
var_dump(linkinfo("./symlink.txt"));
20:
var_dump(linkinfo($initdir."/test/ok/symlink.txt"));
21:
22:
$target = ($initdir."/test/ok/ok.txt");
23:
$symlink = ($initdir."/test/ok/symlink.txt");
24:
var_dump(symlink($target$symlink));
25:
var_dump(linkinfo($symlink));
26:
var_dump(unlink($symlink));
27:
28:
test_open_basedir_after("linkinfo");
29:
?>
30:

Expected

*** Testing open_basedir configuration [linkinfo] ***
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)

Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
bool(false)
int(%d)
bool(true)
*** Finished testing open_basedir configuration [linkinfo] ***

Output

*** Testing open_basedir configuration [linkinfo] ***
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
int(64768)
int(64768)
int(64768)
int(64768)
int(64768)

Warning: symlink(): open_basedir restriction in effect. File(/var/php_gcov/PHP_5_4/tests/security/test/bad/bad.txt) is not within the allowed path(s): (.) in /var/php_gcov/PHP_5_4/tests/security/open_basedir_linkinfo.php on line 24
bool(false)
int(64768)

Warning: unlink(): open_basedir restriction in effect. File(/var/php_gcov/PHP_5_4/tests/security/test/ok/symlink.txt) is not within the allowed path(s): (.) in /var/php_gcov/PHP_5_4/tests/security/open_basedir_linkinfo.php on line 26
bool(false)
*** Finished testing open_basedir configuration [linkinfo] ***

Diff

016+ 
017+ Warning: unlink(): open_basedir restriction in effect. File(/var/php_gcov/PHP_5_4/tests/security/test/ok/symlink.txt) is not within the allowed path(s): (.) in /var/php_gcov/PHP_5_4/tests/security/open_basedir_linkinfo.php on line 26
018+ bool(false)
016- bool(true)

 

Generated at Fri, 24 Oct 2014 05:22:02 +0000 (7 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.