VirtualBox

Changeset 35984 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 15, 2011 4:16:11 PM (14 years ago)
Author:
vboxsync
Message:

Main: prohibit setting a UUID as the machine or snapshot name

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

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

    r35982 r35984  
    938938    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    939939
     940    // prohibit setting a UUID only as the machine name, or else it can
     941    // never be found by findMachine()
     942    Guid test(aName);
     943    if (test.isNotEmpty())
     944        return setError(E_INVALIDARG,  tr("A machine cannot have a UUID as its name"));
     945
    940946    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    941947
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r35915 r35984  
    349349    HRESULT rc = S_OK;
    350350    CheckComArgStrNotEmptyOrNull(aName);
     351
     352    // prohibit setting a UUID only as the machine name, or else it can
     353    // never be found by findMachine()
     354    Guid test(aName);
     355    if (test.isNotEmpty())
     356        return setError(E_INVALIDARG,  tr("A machine cannot have a UUID as its name"));
    351357
    352358    AutoCaller autoCaller(this);
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