aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2018-01-21 12:31:14 +0000
committerPascal Terjan <pterjan@mageia.org>2018-01-21 12:34:07 +0000
commit9f3525d0345c1f4e91c5a7a68043e8efe0a2b5b5 (patch)
tree4f9b88a109f2c0b7a31d4a0758a82a9df2837046 /URPM.xs
parent0f3451e11e4abb2cc297afa51d945ec78050ac4b (diff)
downloadperl-URPM-9f3525d0345c1f4e91c5a7a68043e8efe0a2b5b5.tar
perl-URPM-9f3525d0345c1f4e91c5a7a68043e8efe0a2b5b5.tar.gz
perl-URPM-9f3525d0345c1f4e91c5a7a68043e8efe0a2b5b5.tar.bz2
perl-URPM-9f3525d0345c1f4e91c5a7a68043e8efe0a2b5b5.tar.xz
perl-URPM-9f3525d0345c1f4e91c5a7a68043e8efe0a2b5b5.zip
Fix Urpm_verify_rpm during install
Signatures can't be verified as pubkeys are not available, the code ignores it but that broke with rpm 4.14 (mga#21886). Switch to using rpmtsSetVSFlags and rpmReadPackageFile which should work with older versions too.
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs19
1 files changed, 10 insertions, 9 deletions
diff --git a/URPM.xs b/URPM.xs
index 65729a5..c40dea9 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3073,34 +3073,35 @@ Urpm_verify_rpm(filename, ...)
PREINIT:
FD_t fd;
int i, oldlogmask;
- rpmts ts = NULL;
- struct rpmQVKArguments_s qva;
+ rpmVSFlags vsflags;
CODE:
/* Don't display error messages */
oldlogmask = rpmlogSetMask(RPMLOG_UPTO(RPMLOG_PRI(4)));
- memset(&qva, 0, sizeof(struct rpmQVKArguments_s));
- qva.qva_source = RPMQV_RPM;
- qva.qva_flags = VERIFY_ALL;
+ vsflags = RPMVSF_DEFAULT;
for (i = 1 ; i < items - 1 ; i += 2) {
STRLEN len;
char *s = SvPV(ST(i), len);
if (SvIV(ST(i+1))) {
if (len == 9 && !strncmp(s, "nodigests", 9))
- qva.qva_flags &= ~VERIFY_DIGEST;
+ vsflags |= _RPMVSF_NODIGESTS;
else if (len == 12 && !strncmp(s, "nosignatures", 12))
- qva.qva_flags &= ~VERIFY_SIGNATURE;
+ vsflags |= _RPMVSF_NOSIGNATURES;
}
}
fd = Fopen(filename, "r");
if (fd == NULL)
RETVAL = 0;
else {
+ Header h;
read_config_files(0);
- ts = rpmtsCreate();
+ rpmts ts = rpmtsCreate();
rpmtsSetRootDir(ts, "/");
rpmtsOpenDB(ts, O_RDONLY);
- RETVAL = rpmVerifySignatures(&qva, ts, fd, filename) ? 0 : 1;
+ rpmtsSetVSFlags(ts, vsflags);
+ RETVAL = (rpmReadPackageFile(ts, fd, filename, &h) == RPMRC_OK);
Fclose(fd);
+ if (h)
+ h = headerFree(h);
(void)rpmtsFree(ts);
}
rpmlogSetMask(oldlogmask);