@@ -590,6 +590,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
590590 }
591591
592592#ifdef ZEND_WIN32
593+ retry_reparse_point :
593594 if (save ) {
594595 pathw = php_win32_ioutil_any_to_w (path );
595596 if (!pathw ) {
@@ -612,7 +613,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
612613 tmp = do_alloca (len + 1 , use_heap );
613614 memcpy (tmp , path , len + 1 );
614615
615- retry :
616+ retry_reparse_tag_cloud :
616617 if (save &&
617618 !(IS_UNC_PATH (path , len ) && len >= 3 && path [2 ] != '?' ) &&
618619 (dataw .dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT )
@@ -673,7 +674,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
673674 dataw .dwFileAttributes = fileInformation .dwFileAttributes ;
674675 CloseHandle (hLink );
675676 (* ll )-- ;
676- goto retry ;
677+ goto retry_reparse_tag_cloud ;
677678 }
678679 free_alloca (tmp , use_heap );
679680 CloseHandle (hLink );
@@ -820,6 +821,22 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
820821 free_alloca (pbuffer , use_heap_large );
821822 free (substitutename );
822823
824+ {
825+ DWORD attrs ;
826+
827+ FREE_PATHW ()
828+ pathw = php_win32_ioutil_any_to_w (path );
829+ if (!pathw ) {
830+ return (size_t )-1 ;
831+ }
832+ attrs = GetFileAttributesW (pathw );
833+ if (!isVolume && attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_REPARSE_POINT )) {
834+ free_alloca (tmp , use_heap );
835+ FREE_PATHW ()
836+ goto retry_reparse_point ;
837+ }
838+ }
839+
823840 if (isabsolute == 1 ) {
824841 if (!((j == 3 ) && (path [1 ] == ':' ) && (path [2 ] == '\\' ))) {
825842 /* use_realpath is 0 in the call below coz path is absolute*/
0 commit comments