Changeset 64620 in vbox for trunk/src/VBox
- Timestamp:
- Nov 9, 2016 5:44:36 PM (8 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/fs.h
r62477 r64620 35 35 RT_C_DECLS_BEGIN 36 36 37 RTFMODE rtFsModeFromDos(RTFMODE fMode, const char *pszName, size_t cbName); 37 /** IO_REPARSE_TAG_SYMLINK */ 38 #define RTFSMODE_SYMLINK_REPARSE_TAG UINT32_C(0xa000000c) 39 40 RTFMODE rtFsModeFromDos(RTFMODE fMode, const char *pszName, size_t cbName, uint32_t uReparseTag); 38 41 RTFMODE rtFsModeFromUnix(RTFMODE fMode, const char *pszName, size_t cbName); 39 42 RTFMODE rtFsModeNormalize(RTFMODE fMode, const char *pszName, size_t cbName); -
trunk/src/VBox/Runtime/r3/fs.cpp
r62477 r64620 48 48 * @param pszName The filename which this applies to (exe check). 49 49 * @param cbName The length of that filename. (optional, set 0) 50 */ 51 RTFMODE rtFsModeFromDos(RTFMODE fMode, const char *pszName, size_t cbName) 50 * @param uReparseTag The reparse tag if RTFS_DOS_NT_REPARSE_POINT is set. 51 */ 52 RTFMODE rtFsModeFromDos(RTFMODE fMode, const char *pszName, size_t cbName, uint32_t uReparseTag) 52 53 { 53 54 fMode &= ~((1 << RTFS_DOS_SHIFT) - 1); … … 83 84 84 85 /* Is it really a symbolic link? */ 85 if ( fMode & RTFS_DOS_NT_REPARSE_POINT)86 if ((fMode & RTFS_DOS_NT_REPARSE_POINT) && uReparseTag == RTFSMODE_SYMLINK_REPARSE_TAG) 86 87 fMode = (fMode & ~RTFS_TYPE_MASK) | RTFS_TYPE_SYMLINK; 87 88 … … 138 139 { 139 140 if (!(fMode & RTFS_UNIX_MASK)) 140 fMode = rtFsModeFromDos(fMode, pszName, cbName );141 fMode = rtFsModeFromDos(fMode, pszName, cbName, RTFSMODE_SYMLINK_REPARSE_TAG); 141 142 else if (!(fMode & RTFS_DOS_MASK)) 142 143 fMode = rtFsModeFromUnix(fMode, pszName, cbName); -
trunk/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp
r62592 r64620 580 580 case FILE_ATTRIBUTE_REPARSE_POINT: 581 581 case FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_DIRECTORY: 582 pDirEntry->enmType = RTDIRENTRYTYPE_SYMLINK; 582 /* EaSize is here reused for returning the repharse tag value. */ 583 if (pDir->uCurData.pBoth->EaSize == IO_REPARSE_TAG_SYMLINK) 584 pDirEntry->enmType = RTDIRENTRYTYPE_SYMLINK; 583 585 break; 584 586 } … … 686 688 687 689 pDirEntry->Info.Attr.fMode = rtFsModeFromDos((pBoth->FileAttributes << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT, 688 pszName, cchName );690 pszName, cchName, pBoth->EaSize); 689 691 } 690 692 #ifdef IPRT_WITH_NT_PATH_PASSTHRU -
trunk/src/VBox/Runtime/r3/win/direnum-win.cpp
r62592 r64620 340 340 341 341 pDirEntry->Info.Attr.fMode = rtFsModeFromDos((pDir->Data.dwFileAttributes << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT, 342 pszName, cchName );342 pszName, cchName, pDir->Data.dwReserved0); 343 343 344 344 /* -
trunk/src/VBox/Runtime/r3/win/fileio-win.cpp
r64619 r64620 892 892 pObjInfo->ChangeTime = pObjInfo->ModificationTime; 893 893 894 pObjInfo->Attr.fMode = rtFsModeFromDos((Data.dwFileAttributes << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT, "", 0); 894 pObjInfo->Attr.fMode = rtFsModeFromDos((Data.dwFileAttributes << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT, "", 0, 895 RTFSMODE_SYMLINK_REPARSE_TAG /* (symlink or not, doesn't usually matter here) */); 895 896 896 897 /* -
trunk/src/VBox/Runtime/r3/win/path-win.cpp
r63311 r64620 271 271 * Query file info. 272 272 */ 273 uint32_t uReparseTag = RTFSMODE_SYMLINK_REPARSE_TAG; 273 274 WIN32_FILE_ATTRIBUTE_DATA Data; 274 275 PRTUTF16 pwszPath; … … 297 298 Data.nFileSizeHigh = FindData.nFileSizeHigh; 298 299 Data.nFileSizeLow = FindData.nFileSizeLow; 300 uReparseTag = FindData.dwReserved0; 299 301 } 300 302 else … … 311 313 */ 312 314 /** @todo we're too lazy wrt to error paths here... */ 313 if ( ( fFlags & RTPATH_F_FOLLOW_LINK)314 && ( Data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT))315 if ( (Data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) 316 && ((fFlags & RTPATH_F_FOLLOW_LINK) || uReparseTag != RTFSMODE_SYMLINK_REPARSE_TAG)) 315 317 { 316 318 HANDLE hFinal = CreateFileW(pwszPath, … … 332 334 Data.nFileSizeHigh = FileData.nFileSizeHigh; 333 335 Data.nFileSizeLow = FileData.nFileSizeLow; 336 uReparseTag = 0; 334 337 } 335 338 CloseHandle(hFinal); … … 359 362 360 363 pObjInfo->Attr.fMode = rtFsModeFromDos((Data.dwFileAttributes << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT, 361 pszPath, strlen(pszPath) );364 pszPath, strlen(pszPath), uReparseTag); 362 365 363 366 /*
Note:
See TracChangeset
for help on using the changeset viewer.