Changeset 48117 in vbox for trunk/src/VBox
- Timestamp:
- Aug 28, 2013 8:29:36 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r47970 r48117 1630 1630 void *pvMfBuf = 0; 1631 1631 void *pvCertBuf = 0; 1632 Utf8Str OVFfilename; 1632 1633 1633 1634 writeLock.release(); … … 1668 1669 if (RT_FAILURE(vrc)) 1669 1670 throw setError(VBOX_E_IPRT_ERROR, 1670 tr("Getting the currentfile within the archive failed (%Rrc)"), vrc);1671 tr("Getting the OVF file within the archive failed (%Rrc)"), vrc); 1671 1672 else 1672 1673 { … … 1679 1680 } 1680 1681 } 1682 1683 /* save original OVF filename */ 1684 OVFfilename = pszFilename; 1685 size_t cbMfSize = 0; 1686 size_t cbCertSize = 0; 1687 Utf8Str strMfFile = (Utf8Str(pszFilename)).stripExt().append(".mf"); 1688 Utf8Str strCertFile = (Utf8Str(pszFilename)).stripExt().append(".cert"); 1689 1681 1690 /* Skip the OVF file, cause this was read in IAppliance::Read already. */ 1682 1691 vrc = RTTarSeekNextFile(tar); … … 1704 1713 pStorage->fCreateDigest = true; 1705 1714 1706 size_t cbMfSize = 0;1707 Utf8Str strMfFile = Utf8Str(pszFilename).stripExt().append(".mf");1708 1715 /* Create the import stack for the rollback on errors. */ 1709 1716 ImportStack stack(pTask->locInfo, m->pReader->m_mapDisks, pTask->pProgress); … … 1729 1736 */ 1730 1737 vrc = RTTarCurrentFile(tar, &pszFilename); 1731 if (RT_FAILURE(vrc)) 1732 throw setError(VBOX_E_IPRT_ERROR, 1733 tr("Getting the current file within the archive failed (%Rrc)"), vrc); 1734 1735 size_t cbCertSize = 0; 1736 Utf8Str strCertFile = Utf8Str(pszFilename).stripExt().append(".cert"); 1737 if (pvMfBuf) 1738 { 1739 if (strCertFile.compare(pszFilename) == 0) 1740 { 1741 rc = readTarFileToBuf(tar, strCertFile, &pvCertBuf, &cbCertSize, false, pCallbacks, pStorage); 1742 if (FAILED(rc)) throw rc; 1743 1744 if (pvCertBuf) 1738 if (RT_SUCCESS(vrc)) 1739 { 1740 if (pvMfBuf) 1741 { 1742 if (strCertFile.compare(pszFilename) == 0) 1745 1743 { 1746 /* verify the certificate */ 1744 rc = readTarFileToBuf(tar, strCertFile, &pvCertBuf, &cbCertSize, false, pCallbacks, pStorage); 1745 if (FAILED(rc)) throw rc; 1746 1747 if (pvCertBuf) 1748 { 1749 /* verify the certificate */ 1750 } 1747 1751 } 1748 1752 } … … 1761 1765 { 1762 1766 /* Add the ovf file to the digest list. */ 1763 stack.llSrcDisksDigest.push_front(STRPAIR(Utf8Str(pszFilename).stripExt().append(".ovf"), 1764 m->strOVFSHADigest)); 1767 stack.llSrcDisksDigest.push_front(STRPAIR(OVFfilename, m->strOVFSHADigest)); 1765 1768 rc = verifyManifestFile(strMfFile, stack, pvMfBuf, cbMfSize); 1766 1769 if (FAILED(rc)) throw rc; … … 1772 1775 1773 1776 vrc = RTTarCurrentFile(tar, &pszFilename); 1774 if (RT_FAILURE(vrc)) 1775 throw setError(VBOX_E_IPRT_ERROR, 1776 tr("Getting the current file within the archive failed (%Rrc)"), vrc); 1777 1778 if (strCertFile.compare(pszFilename) == 0) 1777 if (RT_SUCCESS(vrc)) 1779 1778 { 1780 rc = readTarFileToBuf(tar, strCertFile, &pvCertBuf, &cbCertSize, false, pCallbacks, pStorage); 1781 if (FAILED(rc)) throw rc; 1782 1783 if (pvCertBuf) 1779 if (strCertFile.compare(pszFilename) == 0) 1784 1780 { 1785 /* verify the certificate */ 1781 rc = readTarFileToBuf(tar, strCertFile, &pvCertBuf, &cbCertSize, false, pCallbacks, pStorage); 1782 if (FAILED(rc)) throw rc; 1783 1784 if (pvCertBuf) 1785 { 1786 /* verify the certificate */ 1787 } 1786 1788 } 1787 1789 } … … 2382 2384 if (strTrgFormat.compare("RAW", Utf8Str::CaseInsensitive) == 0) 2383 2385 { 2384 void *pvTmpBuf = 0;2385 2386 try 2386 2387 { … … 2405 2406 /* Calculating SHA digest for ISO file while copying one */ 2406 2407 vrc = copyFileAndCalcShaDigest(strSrcFilePath.c_str(), 2407 2408 strTargetPath->c_str(), 2408 2409 pCallbacks, 2409 2410 pRealUsedStorage); … … 2417 2418 catch (HRESULT arc) 2418 2419 { 2419 if (pvTmpBuf)2420 RTMemFree(pvTmpBuf);2421 2420 throw; 2422 2421 } 2423 2424 if (pvTmpBuf)2425 RTMemFree(pvTmpBuf);2426 2422 2427 2423 /* Advance to the next operation. */
Note:
See TracChangeset
for help on using the changeset viewer.