mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
Merge branch 'PHP-7.3' into PHP-7.4
This commit is contained in:
commit
52c2d47c90
32
ext/standard/tests/file/bug77552.phpt
Normal file
32
ext/standard/tests/file/bug77552.phpt
Normal file
@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #77552 Unintialized php_stream_statbuf in stat functions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
// Check lstat on a Windows junction to ensure that st_mode is zero
|
||||
$tmpDir = __DIR__.'/test-bug77552';
|
||||
|
||||
$target = $tmpDir.'/folder/target';
|
||||
mkdir($target, 0777, true);
|
||||
|
||||
$junction = $tmpDir.'/junction';
|
||||
$cmd = sprintf('mklink /J "%s" "%s"', $junction, $target);
|
||||
exec($cmd);
|
||||
|
||||
$stat = lstat($junction);
|
||||
var_dump($stat['mode']);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$tmpDir = __DIR__.'/test-bug77552';
|
||||
$cmd = sprintf('rmdir /S /Q "%s"', $tmpDir);
|
||||
exec($cmd);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
@ -1888,6 +1888,8 @@ PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf
|
||||
const char *path_to_open = path;
|
||||
int ret;
|
||||
|
||||
memset(ssb, 0, sizeof(*ssb));
|
||||
|
||||
if (!(flags & PHP_STREAM_URL_STAT_NOCACHE)) {
|
||||
/* Try to hit the cache first */
|
||||
if (flags & PHP_STREAM_URL_STAT_LINK) {
|
||||
|
Loading…
Reference in New Issue
Block a user