VirtualBox

Changeset 94084 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 3, 2022 10:22:30 PM (3 years ago)
Author:
vboxsync
Message:

Main/Machine: IMachine::mountMedium inadvertently works without
a session. bugref:5490

IMachine::mountMedium() and IMachine::unmountMedium() need to detect and
reject attempts to use an immutable Machine object rather than a mutable
session object from ISession::machine(). This is done by including a
call to i_checkStateDependency(MutableOrRunningStateDep) as is done
elsewhere for IMachine methods that modify a VM's configuration or
settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r93948 r94084  
    45164516                                  this->lockHandle(),
    45174517                                  &mParent->i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
     4518
     4519    HRESULT hrc = i_checkStateDependency(MutableOrRunningStateDep);
     4520    if (FAILED(hrc)) return hrc;
    45184521
    45194522    ComObjPtr<MediumAttachment> pAttach = i_findAttachment(*mMediumAttachments.data(),
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette