rpm/nosignature.diff
OBS User autobuild b4494b17ad Accepting request 37534 from Base:System
Copy from Base:System/rpm based on submit request 37534 from user mlschroe

OBS-URL: https://build.opensuse.org/request/show/37534
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=96
2010-04-13 19:06:36 +00:00

24 lines
678 B
Diff

Do not load keyring if signature checking is disabled.
--- ./lib/package.c.orig 2010-04-09 09:56:42.000000000 +0000
+++ ./lib/package.c 2010-04-09 09:57:50.000000000 +0000
@@ -760,12 +760,16 @@ exit:
rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
{
rpmRC rc;
- rpmKeyring keyring = rpmtsGetKeyring(ts, 1);
rpmVSFlags vsflags = rpmtsVSFlags(ts);
+ rpmKeyring keyring = 0;
+
+ if ((vsflags & _RPMVSF_NOSIGNATURES) != _RPMVSF_NOSIGNATURES)
+ keyring = rpmtsGetKeyring(ts, 1);
rc = rpmpkgRead(keyring, vsflags, fd, fn, hdrp);
- rpmKeyringFree(keyring);
+ if (keyring)
+ rpmKeyringFree(keyring);
return rc;
}