Changeset 105016 in vbox for trunk/src/VBox/Main/src-all
- Timestamp:
- Jun 25, 2024 10:28:21 AM (11 months ago)
- svn:sync-xref-src-repo-rev:
- 163634
- Location:
- trunk/src/VBox/Main/src-all
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/ConsoleSharedFolderImpl.cpp
r98342 r105016 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
r98341 r105016 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 … … 109 111 bool aAutoMount, 110 112 const Utf8Str &aAutoMountPoint, 111 bool fFailOnError) 113 bool fFailOnError, 114 SymlinkPolicy_T enmSymlinkPolicy) 112 115 { 113 116 /* Enclose the state transition NotReady->InInit->Ready */ … … 117 120 unconst(mMachine) = aMachine; 118 121 119 HRESULT hrc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError); 122 HRESULT hrc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError, 123 enmSymlinkPolicy); 120 124 121 125 /* Confirm a successful initialization when it's the case */ … … 152 156 aThat->m->fAutoMount, 153 157 aThat->m->strAutoMountPoint, 154 false /* fFailOnError */ ); 158 false /* fFailOnError */, 159 aThat->m->enmSymlinkPolicy); 155 160 156 161 /* Confirm a successful initialization when it's the case */ … … 214 219 bool aAutoMount, 215 220 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)); 221 bool fFailOnError, 222 SymlinkPolicy_T enmSymlinkPolicy) 223 { 224 LogFlowThisFunc(("aName={%s}, aHostPath={%s}, aWritable={%d}, aAutoMount={%d} enmSymlinkPolicy={%d}\n", 225 aName.c_str(), aHostPath.c_str(), aWritable, aAutoMount, enmSymlinkPolicy)); 220 226 221 227 ComAssertRet(aParent && aName.isNotEmpty() && aHostPath.isNotEmpty(), E_INVALIDARG); … … 271 277 m->fAutoMount = aAutoMount; 272 278 unconst(m->strAutoMountPoint) = aAutoMountPoint; 279 m->enmSymlinkPolicy = enmSymlinkPolicy; 273 280 274 281 return S_OK; … … 385 392 } 386 393 394 HRESULT SharedFolder::getSymlinkPolicy(SymlinkPolicy_T *aSymlinkPolicy) 395 { 396 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 397 *aSymlinkPolicy = m->enmSymlinkPolicy; 398 return S_OK; 399 } 400 401 HRESULT SharedFolder::setSymlinkPolicy(SymlinkPolicy_T aSymlinkPolicy) 402 { 403 switch (aSymlinkPolicy) 404 { 405 case SymlinkPolicy_AllowedToAnyTarget: 406 case SymlinkPolicy_AllowedInShareSubtree: 407 case SymlinkPolicy_AllowedToRelativeTargets: 408 case SymlinkPolicy_Forbidden: 409 break; 410 default: 411 return setError(E_INVALIDARG, tr("The symbolic link policy specified (%d) is invalid."), aSymlinkPolicy); 412 } 413 414 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 415 m->enmSymlinkPolicy = aSymlinkPolicy; 416 return S_OK; 417 } 387 418 388 419 const Utf8Str& SharedFolder::i_getName() const … … 411 442 } 412 443 444 const SymlinkPolicy_T SharedFolder::i_getSymlinkPolicy() const 445 { 446 return m->enmSymlinkPolicy; 447 } 448 413 449 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.