@@ -590,6 +590,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
590
590
}
591
591
592
592
#ifdef ZEND_WIN32
593
+ retry_reparse_point :
593
594
if (save ) {
594
595
pathw = php_win32_ioutil_any_to_w (path );
595
596
if (!pathw ) {
@@ -612,7 +613,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
612
613
tmp = do_alloca (len + 1 , use_heap );
613
614
memcpy (tmp , path , len + 1 );
614
615
615
- retry :
616
+ retry_reparse_tag_cloud :
616
617
if (save &&
617
618
!(IS_UNC_PATH (path , len ) && len >= 3 && path [2 ] != '?' ) &&
618
619
(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
673
674
dataw .dwFileAttributes = fileInformation .dwFileAttributes ;
674
675
CloseHandle (hLink );
675
676
(* ll )-- ;
676
- goto retry ;
677
+ goto retry_reparse_tag_cloud ;
677
678
}
678
679
free_alloca (tmp , use_heap );
679
680
CloseHandle (hLink );
@@ -820,6 +821,22 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
820
821
free_alloca (pbuffer , use_heap_large );
821
822
free (substitutename );
822
823
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
+
823
840
if (isabsolute == 1 ) {
824
841
if (!((j == 3 ) && (path [1 ] == ':' ) && (path [2 ] == '\\' ))) {
825
842
/* use_realpath is 0 in the call below coz path is absolute*/
0 commit comments