Changeset 105087 in vbox for trunk/src/VBox/Main/src-all
- Timestamp:
- Jul 1, 2024 11:27:59 PM (10 months ago)
- svn:sync-xref-src-repo-rev:
- 163708
- Location:
- trunk/src/VBox/Main/src-all
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/ConsoleSharedFolderImpl.cpp
r105018 r105087 44 44 Data() 45 45 : fWritable(false), 46 fAutoMount(false) 46 fAutoMount(false), 47 enmSymlinkPolicy(SymlinkPolicy_None) 47 48 { } 48 49 … … 53 54 const Utf8Str strAutoMountPoint; 54 55 Utf8Str strLastAccessError; 56 SymlinkPolicy_T enmSymlinkPolicy; 55 57 }; 56 58 … … 305 307 } 306 308 309 HRESULT ConsoleSharedFolder::getSymlinkPolicy(SymlinkPolicy_T *aSymlinkPolicy) 310 { 311 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 312 *aSymlinkPolicy = m->enmSymlinkPolicy; 313 return S_OK; 314 } 315 316 HRESULT ConsoleSharedFolder::setSymlinkPolicy(SymlinkPolicy_T aSymlinkPolicy) 317 { 318 RT_NOREF(aSymlinkPolicy); 319 return E_NOTIMPL; 320 } 307 321 308 322 const Utf8Str& ConsoleSharedFolder::i_getName() const … … 331 345 } 332 346 347 const SymlinkPolicy_T ConsoleSharedFolder::i_getSymlinkPolicy() const 348 { 349 return m->enmSymlinkPolicy; 350 } 351 333 352 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/src-all/SharedFolderImpl.cpp
r105018 r105087 46 46 Data() 47 47 : fWritable(false), 48 fAutoMount(false) 48 fAutoMount(false), 49 enmSymlinkPolicy(SymlinkPolicy_None) 49 50 { } 50 51 … … 55 56 const Utf8Str strAutoMountPoint; 56 57 Utf8Str strLastAccessError; 58 SymlinkPolicy_T enmSymlinkPolicy; 57 59 }; 58 60 … … 100 102 * @param aAutoMountPoint Where the guest should try auto mount it. 101 103 * @param fFailOnError Whether to fail with an error if the shared folder path is bad. 104 * @param enmSymlinkPolicy The symbolic link creation policy to apply. 102 105 * 103 106 * @return COM result indicator … … 109 112 bool aAutoMount, 110 113 const Utf8Str &aAutoMountPoint, 111 bool fFailOnError) 114 bool fFailOnError, 115 SymlinkPolicy_T enmSymlinkPolicy) 112 116 { 113 117 /* Enclose the state transition NotReady->InInit->Ready */ … … 117 121 unconst(mMachine) = aMachine; 118 122 119 HRESULT hrc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError); 123 HRESULT hrc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError, 124 enmSymlinkPolicy); 120 125 121 126 /* Confirm a successful initialization when it's the case */ … … 152 157 aThat->m->fAutoMount, 153 158 aThat->m->strAutoMountPoint, 154 false /* fFailOnError */ ); 159 false /* fFailOnError */, 160 aThat->m->enmSymlinkPolicy); 155 161 156 162 /* Confirm a successful initialization when it's the case */ … … 214 220 bool aAutoMount, 215 221 const Utf8Str &aAutoMountPoint, 216 bool fFailOnError) 217 { 218 LogFlowThisFunc(("aName={%s}, aHostPath={%s}, aWritable={%d}, aAutoMount={%d}\n", 219 aName.c_str(), aHostPath.c_str(), aWritable, aAutoMount)); 222 bool fFailOnError, 223 SymlinkPolicy_T enmSymlinkPolicy) 224 { 225 LogFlowThisFunc(("aName={%s}, aHostPath={%s}, aWritable={%d}, aAutoMount={%d} enmSymlinkPolicy={%d}\n", 226 aName.c_str(), aHostPath.c_str(), aWritable, aAutoMount, enmSymlinkPolicy)); 220 227 221 228 ComAssertRet(aParent && aName.isNotEmpty() && aHostPath.isNotEmpty(), E_INVALIDARG); … … 271 278 m->fAutoMount = aAutoMount; 272 279 unconst(m->strAutoMountPoint) = aAutoMountPoint; 280 m->enmSymlinkPolicy = enmSymlinkPolicy; 273 281 274 282 return S_OK; … … 385 393 } 386 394 395 HRESULT SharedFolder::getSymlinkPolicy(SymlinkPolicy_T *aSymlinkPolicy) 396 { 397 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 398 *aSymlinkPolicy = m->enmSymlinkPolicy; 399 return S_OK; 400 } 401 402 HRESULT SharedFolder::setSymlinkPolicy(SymlinkPolicy_T aSymlinkPolicy) 403 { 404 switch (aSymlinkPolicy) 405 { 406 case SymlinkPolicy_AllowedToAnyTarget: 407 case SymlinkPolicy_AllowedInShareSubtree: 408 case SymlinkPolicy_AllowedToRelativeTargets: 409 case SymlinkPolicy_Forbidden: 410 break; 411 default: 412 return setError(E_INVALIDARG, tr("The symbolic link policy specified (%d) is invalid."), aSymlinkPolicy); 413 } 414 415 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 416 m->enmSymlinkPolicy = aSymlinkPolicy; 417 return S_OK; 418 } 387 419 388 420 const Utf8Str& SharedFolder::i_getName() const … … 411 443 } 412 444 445 const SymlinkPolicy_T SharedFolder::i_getSymlinkPolicy() const 446 { 447 return m->enmSymlinkPolicy; 448 } 449 413 450 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.