Changeset 55505 in vbox
- Timestamp:
- Apr 29, 2015 8:26:44 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99859
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r55437 r55505 2993 2993 <interface 2994 2994 name="IAppliance" extends="$unknown" 2995 uuid=" d9432012-2740-499f-b3b3-0991da3679f3"2995 uuid="a529d52c-cf23-4936-9150-e8a6ce77fdad" 2996 2996 wsmap="managed" 2997 2997 > … … 3256 3256 3257 3257 <param name="identifiers" type="wstring" dir="return" safearray="yes"> 3258 The list of password identifiers required on success. 3258 The list of password identifiers required for export on success. 3259 </param> 3260 </method> 3261 3262 <method name="getMediumIdsForPasswordId"> 3263 <desc> 3264 Returns a list of medium identifiers which use the given password identifier. 3265 </desc> 3266 3267 <param name="passwordId" type="wstring" dir="in"> 3268 The password identifier to get the medium identifiers for. 3269 </param> 3270 <param name="identifiers" type="uuid" mod="string" dir="return" safearray="yes"> 3271 The list of medium identifiers returned on success. 3259 3272 </param> 3260 3273 </method> … … 14681 14694 <param name="currentPassword" type="wstring" dir="in"> 14682 14695 <desc> 14683 The olcurrentdpassword the medium is protected with. Use an empty string to indicate14696 The current password the medium is protected with. Use an empty string to indicate 14684 14697 that the medium isn't encrypted. 14685 14698 </desc> -
trunk/src/VBox/Main/include/ApplianceImpl.h
r55184 r55505 106 106 HRESULT getWarnings(std::vector<com::Utf8Str> &aWarnings); 107 107 HRESULT getPasswordIds(std::vector<com::Utf8Str> &aIdentifiers); 108 HRESULT getMediumIdsForPasswordId(const com::Utf8Str &aPasswordId, std::vector<com::Guid> &aIdentifiers); 108 109 HRESULT addPasswords(const std::vector<com::Utf8Str> &aIdentifiers, 109 110 const std::vector<com::Utf8Str> &aPasswords); -
trunk/src/VBox/Main/include/ApplianceImplPrivate.h
r55401 r55505 35 35 typedef std::pair<Utf8Str, Utf8Str> STRPAIR; 36 36 37 typedef std::vector<com::Guid> GUIDVEC; 38 37 39 /* Describe a location for the import/export. The location could be a file on a 38 40 * local hard disk or a remote target based on the supported inet protocols. */ … … 106 108 /** Sequence of password identifiers to encrypt disk images during export. */ 107 109 std::vector<com::Utf8Str> m_vecPasswordIdentifiers; 110 /** Map to get all medium identifiers assoicated with a given password identifier. */ 111 std::map<com::Utf8Str, GUIDVEC> m_mapPwIdToMediumIds; 108 112 /** Secret key store used to hold the passwords during export. */ 109 113 SecretKeyStore *m_pSecretKeyStore; -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r55182 r55505 614 614 } 615 615 616 HRESULT Appliance::getMediumIdsForPasswordId(const com::Utf8Str &aPasswordId, std::vector<com::Guid> &aIdentifiers) 617 { 618 HRESULT hrc = S_OK; 619 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 620 621 std::map<com::Utf8Str, GUIDVEC>::const_iterator it = m->m_mapPwIdToMediumIds.find(aPasswordId); 622 if (it != m->m_mapPwIdToMediumIds.end()) 623 aIdentifiers = it->second; 624 else 625 hrc = setError(E_FAIL, tr("The given password identifier is not associated with any medium")); 626 627 return hrc; 628 } 629 616 630 HRESULT Appliance::addPasswords(const std::vector<com::Utf8Str> &aIdentifiers, 617 631 const std::vector<com::Utf8Str> &aPasswords) -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r55182 r55505 359 359 if (FAILED(rc)) throw rc; 360 360 361 /* If the medium is encrypted add the key identifier to the */361 /* If the medium is encrypted add the key identifier to the list. */ 362 362 IMedium *iBaseMedium = pBaseMedium; 363 363 Medium *pBase = static_cast<Medium*>(iBaseMedium); … … 365 365 if (!strKeyId.isEmpty()) 366 366 { 367 IMedium *iMedium = pMedium; 368 Medium *pMed = static_cast<Medium*>(iMedium); 369 com::Guid mediumUuid = pMed->i_getId(); 367 370 bool fKnown = false; 368 371 … … 378 381 379 382 if (!fKnown) 383 { 384 GUIDVEC vecMediumIds; 385 386 vecMediumIds.push_back(mediumUuid); 380 387 pAppliance->m->m_vecPasswordIdentifiers.push_back(strKeyId); 388 pAppliance->m->m_mapPwIdToMediumIds.insert(std::pair<com::Utf8Str, GUIDVEC>(strKeyId, vecMediumIds)); 389 } 390 else 391 { 392 std::map<com::Utf8Str, GUIDVEC>::iterator it = pAppliance->m->m_mapPwIdToMediumIds.find(strKeyId); 393 if (it == pAppliance->m->m_mapPwIdToMediumIds.end()) 394 throw setError(E_FAIL, tr("Internal error adding a medium UUID to the map")); 395 it->second.push_back(mediumUuid); 396 } 381 397 } 382 398 }
Note:
See TracChangeset
for help on using the changeset viewer.