Skip to content

Commit d36e793

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed #75384 PHP seems incompatible with OneDrive files on demand Fixed ext/date tests due to changes in Olson database
2 parents 3be6810 + c6720e2 commit d36e793

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Zend/zend_virtual_cwd.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@
4545
# define IO_REPARSE_TAG_DEDUP 0x80000013
4646
# endif
4747

48+
# ifndef IO_REPARSE_TAG_CLOUD
49+
# define IO_REPARSE_TAG_CLOUD (0x9000001AL)
50+
# endif
51+
/* IO_REPARSE_TAG_CLOUD_1 through IO_REPARSE_TAG_CLOUD_F have values of 0x9000101AL
52+
to 0x9000F01AL, they can be checked against the mask. */
53+
#ifndef IO_REPARSE_TAG_CLOUD_MASK
54+
#define IO_REPARSE_TAG_CLOUD_MASK (0x0000F000L)
55+
#endif
56+
57+
#ifndef IO_REPARSE_TAG_ONEDRIVE
58+
#define IO_REPARSE_TAG_ONEDRIVE (0x80000021L)
59+
#endif
60+
4861
# ifndef VOLUME_NAME_NT
4962
# define VOLUME_NAME_NT 0x2
5063
# endif
@@ -936,7 +949,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
936949
return -1;
937950
}
938951

939-
hLink = CreateFileW(pathw, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
952+
hLink = CreateFileW(pathw, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
940953
if(hLink == INVALID_HANDLE_VALUE) {
941954
free_alloca(tmp, use_heap);
942955
FREE_PATHW()
@@ -1029,7 +1042,11 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
10291042
return -1;
10301043
}
10311044
}
1032-
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) {
1045+
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP ||
1046+
/* Starting with 1709. */
1047+
(pbuffer->ReparseTag & IO_REPARSE_TAG_CLOUD_MASK) != 0 && 0x90001018L != pbuffer->ReparseTag ||
1048+
IO_REPARSE_TAG_CLOUD == pbuffer->ReparseTag ||
1049+
IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag) {
10331050
isabsolute = 1;
10341051
substitutename = malloc((len + 1) * sizeof(char));
10351052
if (!substitutename) {

0 commit comments

Comments
 (0)