From a907fe4ae3d4ccc18997dbf38c1ee3f6ec63b52572eaecce9895ef1b3f87e532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Fri, 9 Apr 2010 10:28:58 +0000 Subject: [PATCH] - do not load keyring if signature checking is disabled [bnc#554552] - fix nosource/nopatch srpm tag generation OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=49 --- nosignature.diff | 23 +++++++++++++++++++++++ nosource.diff | 36 ++++++++++++++++++++++++++++++++++++ rpm.changes | 6 ++++++ rpm.spec | 4 +++- 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 nosignature.diff create mode 100644 nosource.diff diff --git a/nosignature.diff b/nosignature.diff new file mode 100644 index 0000000..0802056 --- /dev/null +++ b/nosignature.diff @@ -0,0 +1,23 @@ +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; + } + diff --git a/nosource.diff b/nosource.diff new file mode 100644 index 0000000..e824db0 --- /dev/null +++ b/nosource.diff @@ -0,0 +1,36 @@ +rpm does not allow headerPutUint32 on internal tags, so use +headerPut instead. (Maybe NOSOURCE/NOPATCH should not be internal +at all, though.) + +--- ./build/files.c.orig 2010-04-08 16:23:42.000000000 +0000 ++++ ./build/files.c 2010-04-08 16:23:44.000000000 +0000 +@@ -2088,15 +2088,25 @@ int processSourceFiles(rpmSpec spec) + if (srcPtr->flags & RPMBUILD_ISSOURCE) { + headerPutString(spec->sourceHeader, RPMTAG_SOURCE, srcPtr->source); + if (srcPtr->flags & RPMBUILD_ISNO) { +- headerPutUint32(spec->sourceHeader, RPMTAG_NOSOURCE, +- &srcPtr->num, 1); ++ struct rpmtd_s td; ++ rpmtdReset(&td); ++ td.tag = RPMTAG_NOSOURCE; ++ td.type = RPM_INT32_TYPE; ++ td.data = &srcPtr->num; ++ td.count = 1; ++ headerPut(spec->sourceHeader, &td, HEADERPUT_APPEND); + } + } + if (srcPtr->flags & RPMBUILD_ISPATCH) { + headerPutString(spec->sourceHeader, RPMTAG_PATCH, srcPtr->source); + if (srcPtr->flags & RPMBUILD_ISNO) { +- headerPutUint32(spec->sourceHeader, RPMTAG_NOSOURCE, +- &srcPtr->num, 1); ++ struct rpmtd_s td; ++ rpmtdReset(&td); ++ td.tag = RPMTAG_NOPATCH; ++ td.type = RPM_INT32_TYPE; ++ td.data = &srcPtr->num; ++ td.count = 1; ++ headerPut(spec->sourceHeader, &td, HEADERPUT_APPEND); + } + } + diff --git a/rpm.changes b/rpm.changes index d42feac..91e629b 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 9 12:00:29 CEST 2010 - mls@suse.de + +- do not load keyring if signature checking is disabled [bnc#554552] +- fix nosource/nopatch srpm tag generation + ------------------------------------------------------------------- Thu Apr 8 17:11:08 CEST 2010 - mls@suse.de diff --git a/rpm.spec b/rpm.spec index 1abc7f7..576aba9 100644 --- a/rpm.spec +++ b/rpm.spec @@ -111,6 +111,8 @@ Patch74: tarrecordsize.diff Patch75: backport.diff Patch76: pythondeps.diff Patch77: fontprovides.diff +Patch78: nosource.diff +Patch79: nosignature.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -171,7 +173,7 @@ rm -f rpmdb/db.h %patch -P 40 -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48 -P 49 %patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59 %patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 -%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 +%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov