Skip to content

Commit ac2e958

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #80258: Windows Deduplication Enabled, randon permission errors
2 parents 8b59e4e + 848e24f commit ac2e958

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ PHP NEWS
55
- Core:
66
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
77
(cmb)
8+
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
9+
(cmb)
810

911
- IMAP:
1012
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)

Zend/zend_virtual_cwd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void)
492492
static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir) /* {{{ */
493493
{
494494
size_t i, j;
495-
int directory = 0, save;
495+
int directory = 0, save, may_retry_reparse_point;
496496
#ifdef ZEND_WIN32
497497
WIN32_FIND_DATAW dataw;
498498
HANDLE hFind = INVALID_HANDLE_VALUE;
@@ -597,6 +597,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
597597

598598
#ifdef ZEND_WIN32
599599
retry_reparse_point:
600+
may_retry_reparse_point = 0;
600601
if (save) {
601602
pathw = php_win32_ioutil_any_to_w(path);
602603
if (!pathw) {
@@ -691,6 +692,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
691692
CloseHandle(hLink);
692693

693694
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
695+
may_retry_reparse_point = 1;
694696
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
695697
isabsolute = pbuffer->SymbolicLinkReparseBuffer.Flags == 0;
696698
#if VIRTUAL_CWD_DEBUG
@@ -827,7 +829,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
827829
free_alloca(pbuffer, use_heap_large);
828830
free(substitutename);
829831

830-
{
832+
if (may_retry_reparse_point) {
831833
DWORD attrs;
832834

833835
FREE_PATHW()

0 commit comments

Comments
 (0)