diff options
| author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-27 17:51:39 +0200 |
|---|---|---|
| committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-27 17:51:56 +0200 |
| commit | f02507469d0cb8dd202b8674c93251c59f2cbcf2 (patch) | |
| tree | 87b4d2660d4b2627e928b1bb54b5682b516a88c8 | |
| parent | 85a26fef11ace24ba0d8a70fe850109cf66bdbe5 (diff) | |
| parent | 1aeff522b8e5ee77b9ae91bab59699db4dfc2c7e (diff) | |
| download | php-git-f02507469d0cb8dd202b8674c93251c59f2cbcf2.tar.gz | |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Revert "Fix #79806: realpath() erroneously resolves link to link"
| -rw-r--r-- | NEWS | 1 | ||||
| -rw-r--r-- | Zend/zend_virtual_cwd.c | 14 | ||||
| -rw-r--r-- | ext/standard/tests/file/realpath_basic4.phpt | 6 |
3 files changed, 8 insertions, 13 deletions
@@ -5,7 +5,6 @@ PHP NEWS - Core: . Fixed bug #79884 (PHP_CONFIG_FILE_PATH is meaningless). (cmb) . Fixed bug #77932 (File extensions are case-sensitive). (cmb) - . Fixed bug #79806 (realpath() erroneously resolves link to link). (cmb) 06 Aug 2020, PHP 7.4.9 diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index e584d608a9..e784ffc1f4 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -596,7 +596,6 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim } #ifdef ZEND_WIN32 -retry_reparse_point: if (save) { pathw = php_win32_ioutil_any_to_w(path); if (!pathw) { @@ -619,7 +618,7 @@ retry_reparse_point: tmp = do_alloca(len+1, use_heap); memcpy(tmp, path, len+1); -retry_reparse_tag_cloud: +retry: if(save && !(IS_UNC_PATH(path, len) && len >= 3 && path[2] != '?') && (dataw.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) @@ -680,7 +679,7 @@ retry_reparse_tag_cloud: dataw.dwFileAttributes = fileInformation.dwFileAttributes; CloseHandle(hLink); (*ll)--; - goto retry_reparse_tag_cloud; + goto retry; } free_alloca(tmp, use_heap); CloseHandle(hLink); @@ -827,15 +826,6 @@ retry_reparse_tag_cloud: free_alloca(pbuffer, use_heap_large); free(substitutename); - { - DWORD attrs = GetFileAttributesA(path); - if (!isVolume && (attrs & FILE_ATTRIBUTE_REPARSE_POINT)) { - free_alloca(tmp, use_heap); - FREE_PATHW() - goto retry_reparse_point; - } - } - if(isabsolute == 1) { if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) { /* use_realpath is 0 in the call below coz path is absolute*/ diff --git a/ext/standard/tests/file/realpath_basic4.phpt b/ext/standard/tests/file/realpath_basic4.phpt index 524dde3056..1af510d34a 100644 --- a/ext/standard/tests/file/realpath_basic4.phpt +++ b/ext/standard/tests/file/realpath_basic4.phpt @@ -1,5 +1,11 @@ --TEST-- Test realpath() with relative paths +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip no symlinks on Windows'); +} +?> --FILE-- <?php $file_path = __DIR__; |
