Changeset 92822 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Dec 8, 2021 2:55:45 PM (3 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r92817 r92822 869 869 if (MATCH_KEYWORD("CopyIntoExisting")) 870 870 fFlags |= (unsigned)DirectoryCopyFlag_CopyIntoExisting; 871 else if (MATCH_KEYWORD("Recursive")) 872 fFlags |= (unsigned)DirectoryCopyFlag_Recursive; 873 else if (MATCH_KEYWORD("FollowLinks")) 874 fFlags |= (unsigned)DirectoryCopyFlag_FollowLinks; 871 875 else 872 876 return setError(E_INVALIDARG, tr("Invalid directory copy flag: %.*s"), (int)cchKeyword, pszNext); … … 3201 3205 { 3202 3206 hrc = GuestSession::i_directoryCopyFlagFromStr(strFlags, &source.Type.Dir.fCopyFlags); 3203 source.Type.Dir.fRecursive = true; /* Implicit. */3204 3207 } 3205 3208 else if (source.enmType == FsObjType_File) 3206 3209 hrc = GuestSession::i_fileCopyFlagFromStr(strFlags, &source.Type.File.fCopyFlags); 3207 3210 else 3208 return setError(E_INVALIDARG, tr("Source type % dinvalid / not supported"), source.enmType);3211 return setError(E_INVALIDARG, tr("Source type %#x invalid / not supported"), source.enmType); 3209 3212 if (FAILED(hrc)) 3210 3213 return hrc; … … 3272 3275 { 3273 3276 hrc = GuestSession::i_directoryCopyFlagFromStr(strFlags, &source.Type.Dir.fCopyFlags); 3274 source.Type.Dir.fFollowSymlinks = true; /** @todo Add a flag for that in DirectoryCopyFlag_T. Later. */3275 source.Type.Dir.fRecursive = true; /* Implicit. */3276 3277 } 3277 3278 else if (source.enmType == FsObjType_File) 3278 3279 hrc = GuestSession::i_fileCopyFlagFromStr(strFlags, &source.Type.File.fCopyFlags); 3279 3280 else 3280 return setError(E_INVALIDARG, tr("Source type % dinvalid / not supported"), source.enmType);3281 return setError(E_INVALIDARG, tr("Source type %#x invalid / not supported"), source.enmType); 3281 3282 if (FAILED(hrc)) 3282 3283 return hrc; … … 3314 3315 fFlags |= aFlags[i]; 3315 3316 3316 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting; 3317 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting | DirectoryCopyFlag_Recursive 3318 | DirectoryCopyFlag_FollowLinks; 3317 3319 if (fFlags & ~fValidFlags) 3318 3320 return setError(E_INVALIDARG,tr("Unknown flags: flags value %#x, invalid: %#x"), fFlags, fFlags & ~fValidFlags); … … 3327 3329 source.fDryRun = false; /** @todo Implement support for a dry run. */ 3328 3330 source.Type.Dir.fCopyFlags = (DirectoryCopyFlag_T)fFlags; 3329 source.Type.Dir.fRecursive = true; /* Implicit. */3330 3331 3331 3332 SourceSet.push_back(source); … … 3343 3344 fFlags |= aFlags[i]; 3344 3345 3345 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting; 3346 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting | DirectoryCopyFlag_Recursive 3347 | DirectoryCopyFlag_FollowLinks; 3346 3348 if (fFlags & ~fValidFlags) 3347 3349 return setError(E_INVALIDARG,tr("Unknown flags: flags value %#x, invalid: %#x"), fFlags, fFlags & ~fValidFlags); … … 3356 3358 source.fDryRun = false; /** @todo Implement support for a dry run. */ 3357 3359 source.Type.Dir.fCopyFlags = (DirectoryCopyFlag_T)fFlags; 3358 source.Type.Dir.fFollowSymlinks = true; /** @todo Add a flag for that in DirectoryCopyFlag_T. Later. */3359 source.Type.Dir.fRecursive = true; /* Implicit. */3360 3360 3361 3361 SourceSet.push_back(source); -
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r92715 r92822 1004 1004 * will be done directly when working on those. See @bugref{10139}. */ 1005 1005 1006 LogFlowFunc(("mSrcRootAbs=%s, mDstRootAbs=%s, fCopyFlags=%#x, fFollowSymlinks=%RTbool, fRecursive=%RTbool\n", 1007 mSrcRootAbs.c_str(), mDstRootAbs.c_str(), mSourceSpec.Type.Dir.fCopyFlags, 1008 mSourceSpec.Type.Dir.fFollowSymlinks, mSourceSpec.Type.Dir.fRecursive)); 1006 LogFlowFunc(("mSrcRootAbs=%s, mDstRootAbs=%s, fCopyFlags=%#x\n", 1007 mSrcRootAbs.c_str(), mDstRootAbs.c_str(), mSourceSpec.Type.Dir.fCopyFlags)); 1009 1008 1010 1009 return VINF_SUCCESS; … … 1123 1122 LogRel2(("Guest Control: Directory '%s'\n", strEntry.c_str())); 1124 1123 1125 if (!(mSourceSpec.Type.Dir.f Recursive))1124 if (!(mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_Recursive)) 1126 1125 break; 1127 1126 … … 1132 1131 case FsObjType_Symlink: 1133 1132 { 1134 if (mSourceSpec.Type.Dir.f FollowSymlinks)1133 if (mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks) 1135 1134 { 1136 1135 /** @todo Symlink handling from guest is not implemented yet. … … 1234 1233 LogRel2(("Guest Control: Directory '%s'\n", strEntry.c_str())); 1235 1234 1236 if (!(mSourceSpec.Type.Dir.f Recursive))1235 if (!(mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_Recursive)) 1237 1236 break; 1238 1237 … … 1251 1250 case RTFS_TYPE_SYMLINK: 1252 1251 { 1253 if (mSourceSpec.Type.Dir.f FollowSymlinks)1252 if (mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks) 1254 1253 { 1255 1254 Utf8Str strEntryAbs = strPathAbs + Utf8Str(Entry.szName); … … 1443 1442 } 1444 1443 1445 fFollowSymlinks = itSrc->Type.Dir.f FollowSymlinks;1444 fFollowSymlinks = itSrc->Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks; 1446 1445 } 1447 1446 else … … 1838 1837 GuestFsObjData dstObjData; 1839 1838 int rcGuest; 1840 rc = mSession->i_fsQueryInfo(strDstRootAbs, pList->mSourceSpec.Type.Dir.fFollowSymlinks, dstObjData, &rcGuest); 1839 rc = mSession->i_fsQueryInfo(strDstRootAbs, pList->mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks, 1840 dstObjData, &rcGuest); 1841 1841 if (RT_FAILURE(rc)) 1842 1842 { … … 1879 1879 { 1880 1880 fCopyIntoExisting = RT_BOOL(pList->mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_CopyIntoExisting); 1881 fFollowSymlinks = pList->mSourceSpec.Type.Dir.fFollowSymlinks;1881 fFollowSymlinks = RT_BOOL(pList->mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks); 1882 1882 1883 1883 LogFlowFunc(("Directory: fDirCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool\n",
Note:
See TracChangeset
for help on using the changeset viewer.