@@ -596,6 +596,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
596
596
}
597
597
598
598
#ifdef ZEND_WIN32
599
+ retry_reparse_point :
599
600
if (save ) {
600
601
pathw = php_win32_ioutil_any_to_w (path );
601
602
if (!pathw ) {
@@ -618,7 +619,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
618
619
tmp = do_alloca (len + 1 , use_heap );
619
620
memcpy (tmp , path , len + 1 );
620
621
621
- retry :
622
+ retry_reparse_tag_cloud :
622
623
if (save &&
623
624
!(IS_UNC_PATH (path , len ) && len >= 3 && path [2 ] != '?' ) &&
624
625
(dataw .dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT )
@@ -679,7 +680,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
679
680
dataw .dwFileAttributes = fileInformation .dwFileAttributes ;
680
681
CloseHandle (hLink );
681
682
(* ll )-- ;
682
- goto retry ;
683
+ goto retry_reparse_tag_cloud ;
683
684
}
684
685
free_alloca (tmp , use_heap );
685
686
CloseHandle (hLink );
@@ -826,6 +827,22 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
826
827
free_alloca (pbuffer , use_heap_large );
827
828
free (substitutename );
828
829
830
+ {
831
+ DWORD attrs ;
832
+
833
+ FREE_PATHW ()
834
+ pathw = php_win32_ioutil_any_to_w (path );
835
+ if (!pathw ) {
836
+ return (size_t )-1 ;
837
+ }
838
+ attrs = GetFileAttributesW (pathw );
839
+ if (!isVolume && attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_REPARSE_POINT )) {
840
+ free_alloca (tmp , use_heap );
841
+ FREE_PATHW ()
842
+ goto retry_reparse_point ;
843
+ }
844
+ }
845
+
829
846
if (isabsolute == 1 ) {
830
847
if (!((j == 3 ) && (path [1 ] == ':' ) && (path [2 ] == '\\' ))) {
831
848
/* use_realpath is 0 in the call below coz path is absolute*/
0 commit comments