Skip to content

Commit 01c70cc

Browse files
committed
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fixed #75384 PHP seems incompatible with OneDrive files on demand bump versions Fixed ext/date tests due to changes in Olson database
2 parents b6294bb + d36e793 commit 01c70cc

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
@@ -44,6 +44,19 @@
4444
# define IO_REPARSE_TAG_DEDUP 0x80000013
4545
# endif
4646

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

870-
hLink = CreateFileW(pathw, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
883+
hLink = CreateFileW(pathw, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
871884
if(hLink == INVALID_HANDLE_VALUE) {
872885
free_alloca(tmp, use_heap);
873886
FREE_PATHW()
@@ -960,7 +973,11 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
960973
return -1;
961974
}
962975
}
963-
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) {
976+
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP ||
977+
/* Starting with 1709. */
978+
(pbuffer->ReparseTag & IO_REPARSE_TAG_CLOUD_MASK) != 0 && 0x90001018L != pbuffer->ReparseTag ||
979+
IO_REPARSE_TAG_CLOUD == pbuffer->ReparseTag ||
980+
IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag) {
964981
isabsolute = 1;
965982
substitutename = malloc((len + 1) * sizeof(char));
966983
if (!substitutename) {

0 commit comments

Comments
 (0)