@@ -845,6 +845,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
845845 }
846846
847847#ifdef ZEND_WIN32
848+ retry_reparse_point :
848849 if (save ) {
849850 pathw = php_win32_ioutil_any_to_w (path );
850851 if (!pathw ) {
@@ -867,7 +868,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
867868 tmp = do_alloca (len + 1 , use_heap );
868869 memcpy (tmp , path , len + 1 );
869870
870- retry :
871+ retry_reparse_tag_cloud :
871872 if (save &&
872873 !(IS_UNC_PATH (path , len ) && len >= 3 && path [2 ] != '?' ) &&
873874 (dataw .dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT )
@@ -928,7 +929,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
928929 dataw .dwFileAttributes = fileInformation .dwFileAttributes ;
929930 CloseHandle (hLink );
930931 (* ll )-- ;
931- goto retry ;
932+ goto retry_reparse_tag_cloud ;
932933 }
933934 free_alloca (tmp , use_heap );
934935 CloseHandle (hLink );
@@ -1075,6 +1076,22 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
10751076 free_alloca (pbuffer , use_heap_large );
10761077 free (substitutename );
10771078
1079+ {
1080+ DWORD attrs ;
1081+
1082+ FREE_PATHW ()
1083+ pathw = php_win32_ioutil_any_to_w (path );
1084+ if (!pathw ) {
1085+ return (size_t )-1 ;
1086+ }
1087+ attrs = GetFileAttributesW (pathw );
1088+ if (!isVolume && attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_REPARSE_POINT )) {
1089+ free_alloca (tmp , use_heap );
1090+ FREE_PATHW ()
1091+ goto retry_reparse_point ;
1092+ }
1093+ }
1094+
10781095 if (isabsolute == 1 ) {
10791096 if (!((j == 3 ) && (path [1 ] == ':' ) && (path [2 ] == '\\' ))) {
10801097 /* use_realpath is 0 in the call below coz path is absolute*/
0 commit comments