Use new Test() API in libjar to ensure archive integrity before installing.

b = 61544
 r = dveditz
sr = dveditz
This commit is contained in:
sgehani%netscape.com 2000-12-27 07:06:58 +00:00
Родитель 7809953dde
Коммит a8b9ca6dec
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -184,6 +184,14 @@ GetInstallScriptFromJarfile(nsIZipReader* hZip, nsIFile* jarFile, char** scriptB
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return nsInstall::CANT_READ_ARCHIVE; return nsInstall::CANT_READ_ARCHIVE;
// CRC check the integrity of all items in this archive
rv = hZip->Test(nsnull);
if (NS_FAILED(rv))
{
NS_ASSERTION(0, "CRC check of archive failed!");
return nsInstall::CANT_READ_ARCHIVE;
}
// Extract the install.js file to the temporary directory // Extract the install.js file to the temporary directory
nsSpecialSystemDirectory installJSFileSpec(nsSpecialSystemDirectory::OS_TemporaryDirectory); nsSpecialSystemDirectory installJSFileSpec(nsSpecialSystemDirectory::OS_TemporaryDirectory);
installJSFileSpec += "install.js"; installJSFileSpec += "install.js";