Skip to content

Fix GH-11808: Live filesystem modified by tests (security) #13566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions ext/standard/tests/file/006_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,9 @@ require __DIR__ . '/../skipif_root.inc';
<?php
echo "*** Testing error conditions for fileperms(), chmod() ***\n";

/* With standard files and dirs */
var_dump( chmod("/etc/passwd", 0777) );
printf("%o", fileperms("/etc/passwd") );
echo "\n";
clearstatcache();

var_dump( chmod("/etc", 0777) );
printf("%o", fileperms("/etc") );
echo "\n";
clearstatcache();

/* With non-existing file or dir */
var_dump( chmod("/no/such/file/dir", 0777) );
var_dump( fileperms("/no/such/file/dir") );
var_dump( chmod(__DIR__ . "/no/such/file/dir", 0777) );
var_dump( fileperms(__DIR__ . "/no/such/file/dir") );
echo "\n";

echo "\n*** Done ***\n";
Expand All @@ -34,16 +23,8 @@ echo "\n*** Done ***\n";

Warning: chmod(): %s in %s on line %d
bool(false)
100%d44

Warning: chmod(): %s in %s on line %d
bool(false)
40755

Warning: chmod(): No such file or directory in %s on line %d
bool(false)

Warning: fileperms(): stat failed for /no/such/file/dir in %s on line %d
Warning: fileperms(): stat failed for %s/no/such/file/dir in %s on line %d
bool(false)


Expand Down