VirtualBox

Changeset 59516 in vbox


Ignore:
Timestamp:
Jan 29, 2016 8:14:44 AM (9 years ago)
Author:
vboxsync
Message:

bugref:6022. OVF import: Workaround in the case if there is no the SHA digest of OVF description file inside manifest file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/checksum/manifest.cpp

    r57387 r59516  
    5252    char *pszManifestDigest;
    5353    PRTMANIFESTTEST pTestPattern;
     54    bool fSkipThisFile;
    5455} RTMANIFESTFILEENTRY;
    5556typedef RTMANIFESTFILEENTRY* PRTMANIFESTFILEENTRY;
     
    348349    /* Fill our compare list */
    349350    for (size_t i = 0; i < cTests; ++i)
     351    {
    350352        paFiles[i].pTestPattern = &paTests[i];
     353        paFiles[i].fSkipThisFile = false;
     354    }
    351355
    352356    char *pcBuf = (char*)pvBuf;
     
    468472                break;
    469473            }
     474            else
     475            {
     476                /*
     477                * use case when manifest file doesn't contain the SHA digest of OVF description file
     478                * OVF2.0 standard says that "The manifest file shall contain SHA digests for all distinct files
     479                * referenced in the References element of the OVF descriptor and for no other files."
     480                * So we have OVF description file in our package file list but there is no SHA digest for him.
     481                */
     482                char *suffix = RTPathSuffix(paFiles[i].pTestPattern->pszTestFile);//get suffix
     483
     484                if (RTStrICmp(suffix, ".ovf") == 0)
     485                {
     486                    paFiles[i].fSkipThisFile = true;//workaround for this case
     487                    fFound = true;
     488                }
     489            }
    470490        }
    471491        RTMemTmpFree(pszName);
     
    488508        for (size_t i = 0; i < cTests; ++i)
    489509        {
     510            if(paFiles[i].fSkipThisFile == true)
     511                continue;
    490512            /* If there is an entry in the file list, which hasn't an
    491513             * equivalent in the manifest file, its an error. */
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