Added support to check the SHA256 hash for any binpkg before installation happens.

--HG--
extra : convert_revision : 4f812eb0cfb614461527e360db1692bd5f9c34aa
This commit is contained in:
Juan RP 2009-03-02 23:38:24 +01:00
parent 05f918ea93
commit 37e4be86f9
6 changed files with 74 additions and 14 deletions

View file

@ -111,6 +111,7 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
{
prop_dictionary_t repod, pkgrd;
struct cbargs *cb = arg;
const char *repoloc;
char *plist;
int rv = 0;
@ -139,6 +140,16 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
/*
* Check SHA256 hash for binary package before anything else.
*/
if (!prop_dictionary_get_cstring_nocopy(repod, "location-local",
&repoloc)) {
prop_object_release(repod);
return EINVAL;
}
if ((rv = xbps_check_pkg_file_hash(pkgrd, repoloc)) != 0) {
prop_object_release(repod);
return rv;
}
/*
* Check if this package needs dependencies.