Skip to content

Fix #80258: Windows Deduplication Enabled, randon permission errors #6354

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 1 commit into from
Closed
Changes from all commits
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
6 changes: 4 additions & 2 deletions Zend/zend_virtual_cwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void)
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) /* {{{ */
{
size_t i, j;
int directory = 0, save;
int directory = 0, save, may_retry_reparse_point;
#ifdef ZEND_WIN32
WIN32_FIND_DATAW dataw;
HANDLE hFind = INVALID_HANDLE_VALUE;
Expand Down Expand Up @@ -846,6 +846,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim

#ifdef ZEND_WIN32
retry_reparse_point:
may_retry_reparse_point = 0;
if (save) {
pathw = php_win32_ioutil_any_to_w(path);
if (!pathw) {
Expand Down Expand Up @@ -940,6 +941,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
CloseHandle(hLink);

if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
may_retry_reparse_point = 1;
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
#if VIRTUAL_CWD_DEBUG
Expand Down Expand Up @@ -1076,7 +1078,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
free_alloca(pbuffer, use_heap_large);
free(substitutename);

{
if (may_retry_reparse_point) {
DWORD attrs;

FREE_PATHW()
Expand Down