Changeset 39612 in vbox for trunk/src/VBox/HostServices/SharedFolders
- Timestamp:
- Dec 14, 2011 2:19:55 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75392
- Location:
- trunk/src/VBox/HostServices/SharedFolders
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r39543 r39612 125 125 static RTFMODE testRTDirCreateMode; 126 126 127 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode )127 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate) 128 128 { 129 129 /* RTPrintf("%s: pszPath=%s, fMode=0x%llx\n", __PRETTY_FUNCTION__, pszPath, … … 389 389 } 390 390 391 extern int testRTSymlinkDelete(const char *pszSymlink) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 391 extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete) 392 { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 392 393 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, 393 size_t cbTarget) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 394 size_t cbTarget, uint32_t fRead) 395 { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 394 396 395 397 /****************************************************************************** -
trunk/src/VBox/HostServices/SharedFolders/teststubs.h
r39542 r39612 30 30 extern int testRTDirClose(PRTDIR pDir); 31 31 #define RTDirCreate testRTDirCreate 32 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode );32 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate); 33 33 #define RTDirOpen testRTDirOpen 34 34 extern int testRTDirOpen(PRTDIR *ppDir, const char *pszPath); … … 76 76 extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags); 77 77 #define RTSymlinkDelete testRTSymlinkDelete 78 extern int testRTSymlinkDelete(const char *pszSymlink );78 extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete); 79 79 #define RTSymlinkRead testRTSymlinkRead 80 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget );80 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead); 81 81 82 82 #endif /* __VBSF_TEST_STUBS__H */ -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r39607 r39612 139 139 strcat(pDirEntry->szName, szWildCard); 140 140 141 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT );141 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS); 142 142 *(pszStartComponent-1) = RTPATH_DELIMITER; 143 143 if (RT_FAILURE(rc)) … … 582 582 static int vbsfConvertFileOpenFlags(unsigned fShflFlags, RTFMODE fMode, SHFLHANDLE handleInitial, uint32_t *pfOpen) 583 583 { 584 uint32_t fOpen = 0;584 uint32_t fOpen = RTFILE_O_NO_SYMLINKS; 585 585 int rc = VINF_SUCCESS; 586 586 … … 1011 1011 1012 1012 pParms->Result = SHFL_FILE_CREATED; 1013 rc = RTDirCreate(pszPath, fMode );1013 rc = RTDirCreate(pszPath, fMode, RTDIRCREATE_FLAGS_NO_SYMLINKS); 1014 1014 if (RT_FAILURE(rc)) 1015 1015 { … … 1031 1031 { 1032 1032 /* Open the directory now */ 1033 rc = RTDirOpen(&pHandle->dir.Handle, pszPath); 1033 rc = RTDirOpenFiltered(&pHandle->dir.Handle, pszPath, 1034 RTDIRFILTER_NONE, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS); 1034 1035 if (RT_SUCCESS(rc)) 1035 1036 { … … 1545 1546 if (RT_SUCCESS(rc)) 1546 1547 { 1547 rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath, RTDIRFILTER_WINNT); 1548 rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath, 1549 RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS); 1548 1550 1549 1551 /* free the path string */ … … 1728 1730 if (RT_SUCCESS(rc)) 1729 1731 { 1730 rc = RTSymlinkRead(pszFullPath, (char *) pBuffer, cbBuffer );1732 rc = RTSymlinkRead(pszFullPath, (char *) pBuffer, cbBuffer, RTSYMLINKREAD_FLAGS_NO_SYMLINKS); 1731 1733 1732 1734 /* free the path string */ … … 1851 1853 #endif 1852 1854 1853 rc = RTFileSetMode( (RTFILE)pHandle->file.Handle, fMode);1855 rc = RTFileSetMode(pHandle->file.Handle, fMode); 1854 1856 if (rc != VINF_SUCCESS) 1855 1857 { … … 2175 2177 { 2176 2178 if (flags & SHFL_REMOVE_SYMLINK) 2177 rc = RTSymlinkDelete(pszFullPath); 2178 else if (flags & SHFL_REMOVE_FILE) 2179 rc = RTFileDelete(pszFullPath); 2179 rc = RTSymlinkDelete(pszFullPath, RTSYMLINKDELETE_FLAGS_NO_SYMLINKS); 2180 2180 else 2181 rc = RT DirRemove(pszFullPath);2181 rc = RTPathUnlink(pszFullPath, RTPATHUNLINK_FLAGS_NO_SYMLINKS); 2182 2182 } 2183 2183 … … 2241 2241 if (flags & SHFL_RENAME_FILE) 2242 2242 { 2243 rc = RTFileMove(pszFullPathSrc, pszFullPathDest, (flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTFILEMOVE_FLAGS_REPLACE : 0); 2243 rc = RTFileMove(pszFullPathSrc, pszFullPathDest, 2244 ((flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTFILEMOVE_FLAGS_REPLACE : 0) 2245 | RTFILEMOVE_FLAGS_NO_SYMLINKS); 2244 2246 } 2245 2247 else 2246 2248 { 2247 2249 /* NT ignores the REPLACE flag and simply return and already exists error. */ 2248 rc = RTDirRename(pszFullPathSrc, pszFullPathDest, (flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTPATHRENAME_FLAGS_REPLACE : 0); 2250 rc = RTDirRename(pszFullPathSrc, pszFullPathDest, 2251 ((flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTPATHRENAME_FLAGS_REPLACE : 0) 2252 | RTPATHRENAME_FLAGS_NO_SYMLINKS); 2249 2253 } 2250 2254 } … … 2286 2290 return rc; 2287 2291 2288 rc = RTSymlinkCreate(pszFullNewPath, (const char *)pOldPath->String.utf8, RTSYMLINKTYPE_UNKNOWN); 2292 rc = RTSymlinkCreate(pszFullNewPath, (const char *)pOldPath->String.utf8, 2293 RTSYMLINKTYPE_UNKNOWN, RTSYMLINKCREATE_FLAGS_NO_SYMLINKS); 2289 2294 if (RT_SUCCESS(rc)) 2290 2295 {
Note:
See TracChangeset
for help on using the changeset viewer.