Changeset 6384 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jan 18, 2008 9:15:20 PM (17 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedFolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r6382 r6384 28 28 * 29 29 */ 30 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName )30 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable) 31 31 { 32 32 int i; … … 73 73 FolderMapping[i].fValid = true; 74 74 FolderMapping[i].cMappings = 0; 75 FolderMapping[i].fWritable = fWritable; 75 76 76 77 /* Check if the host file system is case sensitive */ … … 232 233 } 233 234 235 int vbsfMappingsQueryWritable (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable) 236 { 237 int rc = VINF_SUCCESS; 238 239 LogFlow(("vbsfMappingsQueryWritable: pClient = %p, root = %d\n", 240 pClient, root)); 241 242 if (root >= SHFL_MAX_MAPPINGS) 243 return VERR_INVALID_PARAMETER; 244 245 if (FolderMapping[root].fValid == true) 246 *fWritable = FolderMapping[root].fWritable; 247 else 248 rc = VERR_FILE_NOT_FOUND; 249 250 LogFlow(("vbsfMappingsQuery:Writable return rc = %Vrc\n", rc)); 251 252 return rc; 253 } 254 234 255 static int vbsfQueryMappingIndex (PRTUTF16 utf16Name, size_t *pIndex) 235 256 { -
trunk/src/VBox/HostServices/SharedFolders/mappings.h
r6382 r6384 31 31 bool fHostCaseSensitive; 32 32 bool fGuestCaseSensitive; 33 bool fWritable; 33 34 } MAPPING, *PMAPPING; 34 35 … … 37 38 bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping); 38 39 39 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName );40 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable); 40 41 int vbsfMappingsRemove (PSHFLSTRING pMapName); 41 42 42 43 int vbsfMappingsQuery (SHFLCLIENTDATA *pClient, SHFLMAPPING *pMappings, uint32_t *pcMappings); 43 44 int vbsfMappingsQueryName (SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pString); 45 int vbsfMappingsQueryWritable (SHFLCLIENTDATA *pClient, SHFLROOT root, bool *fWritable); 44 46 45 47 int vbsfMapFolder (SHFLCLIENTDATA *pClient, PSHFLSTRING pszMapName, RTUCS2 delimiter, bool fCaseSensitive, SHFLROOT *pRoot); -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r6382 r6384 1097 1097 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_PTR /* host folder name */ 1098 1098 || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* guest map name */ 1099 || paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* fWritable */ 1099 1100 ) 1100 1101 { … … 1108 1109 SHFLSTRING *pMapName = (SHFLSTRING *)paParms[1].u.pointer.addr; 1109 1110 uint32_t cbStringMap = paParms[1].u.pointer.size; 1111 uint32_t fWritable = paParms[2].u.uint32; 1110 1112 1111 1113 /* Verify parameters values. */ … … 1121 1123 { 1122 1124 /* Execute the function. */ 1123 rc = vbsfMappingsAdd (pFolderName, pMapName );1125 rc = vbsfMappingsAdd (pFolderName, pMapName, fWritable); 1124 1126 1125 1127 if (VBOX_SUCCESS(rc)) -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r6382 r6384 1018 1018 } 1019 1019 } 1020 1021 /* write access requested? */ 1022 if (pParms->CreateFlags & ( SHFL_CF_ACT_REPLACE_IF_EXISTS 1023 | SHFL_CF_ACT_OVERWRITE_IF_EXISTS 1024 | SHFL_CF_ACT_CREATE_IF_NEW 1025 | SHFL_CF_ACCESS_WRITE)) 1026 { 1027 /* is the guest allowed to write to this share? */ 1028 bool fWritable; 1029 rc = vbsfMappingsQueryWritable (pClient, root, &fWritable); 1030 if (RT_FAILURE(rc) || !fWritable) 1031 return VERR_WRITE_PROTECT; 1032 } 1033 1020 1034 if (BIT_FLAG(pParms->CreateFlags, SHFL_CF_DIRECTORY)) 1021 1035 {
Note:
See TracChangeset
for help on using the changeset viewer.