Changeset 65998 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Mar 8, 2017 8:03:24 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 113847
- Location:
- trunk/src/VBox/HostServices/SharedFolders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r62791 r65998 22 22 #include <iprt/alloc.h> 23 23 #include <iprt/assert.h> 24 #include <iprt/path.h> 24 25 #include <iprt/string.h> 25 26 … … 224 225 if (FolderMapping[i].fValid == false) 225 226 { 226 FolderMapping[i].pszFolderName = RTStrDup(pszFolderName); 227 /* Make sure the folder name is an absolute path, otherwise we're 228 likely to get into trouble with buffer sizes in vbsfPathGuestToHost. */ 229 char szAbsFolderName[RTPATH_MAX]; 230 int rc = RTPathAbs(pszFolderName, szAbsFolderName, sizeof(szAbsFolderName)); 231 AssertRCReturn(rc, rc); 232 233 FolderMapping[i].pszFolderName = RTStrDup(szAbsFolderName); 227 234 if (!FolderMapping[i].pszFolderName) 228 235 { … … 253 260 RTFSPROPERTIES prop; 254 261 prop.fCaseSensitive = false; /* Shut up MSC. */ 255 char *pszAsciiRoot; 256 257 int rc = RTStrUtf8ToCurrentCP(&pszAsciiRoot, FolderMapping[i].pszFolderName); 258 if (RT_SUCCESS(rc)) 259 { 260 rc = RTFsQueryProperties(pszAsciiRoot, &prop); 261 AssertRC(rc); 262 RTStrFree(pszAsciiRoot); 263 } 264 262 rc = RTFsQueryProperties(FolderMapping[i].pszFolderName, &prop); 263 AssertRC(rc); 265 264 FolderMapping[i].fHostCaseSensitive = RT_SUCCESS(rc) ? prop.fCaseSensitive : false; 266 265 vbsfRootHandleAdd(i); -
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r63760 r65998 751 751 RTTEST_CHECK_RC_OK(hTest, rc); 752 752 RTTEST_CHECK_MSG(hTest, 753 !strcmp(testRTFileOpenName, "/test/mapping/test/file"), 754 (hTest, "pszFilename=%s\n", testRTFileOpenName)); 753 !strcmp(&testRTFileOpenName[RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS ? 2 : 0], 754 "/test/mapping/test/file"), 755 (hTest, "pszFilename=%s\n", &testRTFileOpenName[RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS ? 2 : 0])); 755 756 RTTEST_CHECK_MSG(hTest, testRTFileOpenFlags == 0x181, 756 757 (hTest, "fOpen=%llu\n", LLUIFY(testRTFileOpenFlags))); … … 781 782 RTTEST_CHECK_RC_OK(hTest, rc); 782 783 RTTEST_CHECK_MSG(hTest, 783 !strcmp(testRTDirCreatePath, "/test/mapping/test/dir"), 784 (hTest, "pszPath=%s\n", testRTDirCreatePath)); 784 !strcmp(&testRTDirCreatePath[RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS ? 2 : 0], 785 "/test/mapping/test/dir"), 786 (hTest, "pszPath=%s\n", &testRTDirCreatePath[RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS ? 2 : 0])); 785 787 RTTEST_CHECK_MSG(hTest, 786 !strcmp(testRTDirOpenName, "/test/mapping/test/dir"), 787 (hTest, "pszFilename=%s\n", testRTDirOpenName)); 788 !strcmp(&testRTDirOpenName[RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS ? 2 : 0], 789 "/test/mapping/test/dir"), 790 (hTest, "pszFilename=%s\n", &testRTDirOpenName[RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS ? 2 : 0])); 788 791 RTTEST_CHECK_MSG(hTest, Result == SHFL_FILE_CREATED, 789 792 (hTest, "Result=%d\n", (int) Result)); … … 924 927 const uint32_t fMode = 0660; 925 928 SHFLFSOBJINFO Info; 926 SHFLHANDLE Handle;927 929 int rc; 928 930 … … 930 932 Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers, 931 933 "/test/mapping", "testname"); 934 SHFLHANDLE Handle = SHFL_HANDLE_NIL; 932 935 testRTFileOpenpFile = hcFile; 933 936 rc = createFile(&svcTable, Root, "/test/file", SHFL_CF_ACCESS_READ, 934 937 &Handle, NULL); 935 RTTEST_CHECK_RC_OK(hTest, rc); 938 RTTEST_CHECK_RC_OK_RETV(hTest, rc); 939 936 940 RT_ZERO(Info); 937 941 testRTFileQueryInfoFMode = fMode;
Note:
See TracChangeset
for help on using the changeset viewer.