From 7fca3339aa7c6e98b1e805811590c30e3b2160d1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 5 Mar 2009 11:13:00 +0000 Subject: (verify_signature) make checking urpmi signatures works in chrooted environments (especially important for installer where there's no rpmdb in / (really /var/lib/rpm) and thus no keys to check against) --- NEWS | 4 ++++ URPM.xs | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c247f3f..913cac4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +- verify_signature: enable to check signatures against a chrooted rpmdb + (especially important for installer where there's no rpmdb in / and thus no + keys to check against) + Version 3.25 - 16 January 2009, by Christophe Fergeau - previous fix for bug #46874 was bogus, really fix it this time diff --git a/URPM.xs b/URPM.xs index cfbfad1..2269cd7 100644 --- a/URPM.xs +++ b/URPM.xs @@ -3728,8 +3728,9 @@ Urpm_verify_rpm(filename, ...) RETVAL char * -Urpm_verify_signature(filename) +Urpm_verify_signature(filename, prefix="/") char *filename + char *prefix PREINIT: rpmts ts = NULL; char result[1024]; @@ -3743,7 +3744,7 @@ Urpm_verify_signature(filename) } else { read_config_files(0); ts = rpmtsCreate(); - rpmtsSetRootDir(ts, "/"); + rpmtsSetRootDir(ts, prefix); rpmtsOpenDB(ts, O_RDONLY); rpmtsSetVSFlags(ts, RPMVSF_DEFAULT); rc = rpmReadPackageFile(ts, fd, filename, &h); -- cgit v1.2.1