-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Vlasov
committed
Aug 14, 2019
1 parent
2f16818
commit b2072a6
Showing
2 changed files
with
20 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,40 @@ | ||
--TEST-- | ||
Check writing to files in new dir with dir mask | ||
Check directory mask on instance directory | ||
--INI-- | ||
shadow.mkdir_mask=0755 | ||
shadow.mkdir_mask=0777 | ||
--SKIPIF-- | ||
<?php if (!extension_loaded('shadow')) { | ||
print 'skip'; | ||
} ?> | ||
<?php if (exec('whoami') == 'root') { | ||
print 'skip'; | ||
} ?> | ||
--XFAIL-- | ||
nrh: 20150605: We belive this feature to be unimplemnted, see CRYS-959 | ||
--FILE-- | ||
<?php | ||
require_once 'setup.inc'; | ||
|
||
chdir($template); | ||
umask(0); | ||
|
||
mkdir("txt/new/"); | ||
mkdir("txt/new/dir/"); | ||
file_put_contents("txt/new/dir/_twrite.txt", "writing as template\n"); | ||
|
||
mkdir("txt/new2/"); | ||
mkdir("txt/new2/dir/"); | ||
ini_set('shadow.mkdir_mask', '0700'); | ||
file_put_contents("txt/new2/dir/_twrite.txt", "writing as template\n"); | ||
mkdir("txt/new2/dir7000/"); | ||
touch('non-existing/test.txt'); | ||
|
||
clearstatcache(); | ||
|
||
$stat = stat("txt/new/dir/"); | ||
$stat = stat($instance . '/non-existing/'); | ||
echo substr(decoct($stat['mode']), -5) . PHP_EOL; | ||
|
||
$stat = stat("txt/new/"); | ||
echo substr(decoct($stat['mode']), -5) . PHP_EOL; | ||
unlink('non-existing/test.txt'); | ||
rmdir($instance . '/non-existing/'); | ||
|
||
$stat = stat("txt/new2/dir/"); | ||
echo substr(decoct($stat['mode']), -5) . PHP_EOL; | ||
ini_set('shadow.mkdir_mask', '0700'); | ||
|
||
$stat = stat("txt/new2/"); | ||
echo substr(decoct($stat['mode']), -5) . PHP_EOL; | ||
|
||
$stat = stat("txt/new2/dir7000/"); | ||
echo substr(decoct($stat['mode']), -5) . PHP_EOL; | ||
touch('non-existing/test.txt'); | ||
|
||
clearstatcache(); | ||
|
||
unlink("txt/new/dir/_twrite.txt"); | ||
rmdir("txt/new/dir"); | ||
var_dump(rmdir("txt/new")); | ||
$stat = stat($instance . '/non-existing/'); | ||
echo substr(decoct($stat['mode']), -5) . PHP_EOL; | ||
|
||
unlink("txt/new2/dir/_twrite.txt"); | ||
rmdir("txt/new2/dir7000/"); | ||
rmdir("txt/new2/dir"); | ||
var_dump(rmdir("txt/new2")); | ||
unlink('non-existing/test.txt'); | ||
rmdir($instance . '/non-existing/'); | ||
?> | ||
--EXPECT-- | ||
40755 | ||
40755 | ||
40755 | ||
40755 | ||
40755 | ||
40777 | ||
40700 | ||
bool(true) | ||
bool(true) |