[oe-commits] [openembedded-core] 29/72: rpm: make --nosignature work

git at git.openembedded.org git at git.openembedded.org
Mon Jul 25 22:52:57 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 038c09d6ab9581030efdc16aa1b96972970eeaab
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Sun Jul 17 20:32:41 2016 -0700

    rpm: make --nosignature work
    
    OE-core uses rpm's --nosignature, but it never worked:
    self._invoke_smart('config --set rpm-check-signatures=false')
    
    Now fix it with:
    * Define SUPPORT_NOSIGNATURES to 1 in system.h
    * !QVA_ISSET(qva->qva_flags, SIGNATURE) -> QVA_ISSET(qva->qva_flags, SIGNATURE),
      otherwise, when use --nosignature would read database and verify
      signature, this is not expected.
    
    This can fix some race issues, for example, when more than one process
    are querying rpm file with "rpm -qp --nosignature", they may hang up
    because of race issues (the processes are trying to get RW/RD lock on
    the database, but they shouldn't read the database at all since -qp and
    --nosignature are used).
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 ...0001-system.h-query.c-support-nosignature.patch | 64 ++++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.16.bb            |  1 +
 2 files changed, 65 insertions(+)

diff --git a/meta/recipes-devtools/rpm/rpm/0001-system.h-query.c-support-nosignature.patch b/meta/recipes-devtools/rpm/rpm/0001-system.h-query.c-support-nosignature.patch
new file mode 100644
index 0000000..410ae78
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/0001-system.h-query.c-support-nosignature.patch
@@ -0,0 +1,64 @@
+From d8fcc3cbeec4defb5babde5bd09ea294dd3fd08b Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang at windriver.com>
+Date: Sun, 3 Jul 2016 19:01:59 -0700
+Subject: [PATCH] system.h/query.c: support nosignature
+
+* Define SUPPORT_NOSIGNATURES to 1 in system.h
+* !QVA_ISSET(qva->qva_flags, SIGNATURE) -> QVA_ISSET(qva->qva_flags, SIGNATURE),
+  otherwise, when use --nosignature would read database and verify
+  signature, this is not expected.
+
+Upstream-Status: Submitting [Sent email to rpm-devel at rpm5.org]
+
+Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
+---
+ lib/query.c | 6 +++---
+ system.h    | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/lib/query.c b/lib/query.c
+index 50a7453..b761d76 100644
+--- a/lib/query.c
++++ b/lib/query.c
+@@ -954,19 +954,19 @@ JBJDEBUG((stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, qva, argv));
+     vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_query}");
+     vsflags = (rpmVSFlags) 0;	/* XXX FIXME: ignore default disablers. */
+ #if defined(SUPPORT_NOSIGNATURES)
+-    if (!QVA_ISSET(qva->qva_flags, DIGEST)) {
++    if (QVA_ISSET(qva->qva_flags, DIGEST)) {
+ 	VSF_SET(vsflags, NOSHA1HEADER);
+ 	VSF_SET(vsflags, NOMD5HEADER);
+ 	VSF_SET(vsflags, NOSHA1);
+ 	VSF_SET(vsflags, NOMD5);
+     }
+-    if (!QVA_ISSET(qva->qva_flags, SIGNATURE)) {
++    if (QVA_ISSET(qva->qva_flags, SIGNATURE)) {
+ 	VSF_SET(vsflags, NODSAHEADER);
+ 	VSF_SET(vsflags, NORSAHEADER);
+ 	VSF_SET(vsflags, NODSA);
+ 	VSF_SET(vsflags, NORSA);
+     }
+-    if (!QVA_ISSET(qva->qva_flags, HDRCHK)) {
++    if (QVA_ISSET(qva->qva_flags, HDRCHK)) {
+ 	VSF_SET(vsflags, NOHDRCHK);
+     }
+     VSF_CLR(vsflags, NEEDPAYLOAD);	/* XXX needed? */
+diff --git a/system.h b/system.h
+index 2ff8906..ad4619a 100644
+--- a/system.h
++++ b/system.h
+@@ -787,9 +787,9 @@ static inline const char *rcsid(const char *p) { \
+ #define SUPPORT_I18NSTRING_TYPE	1
+ 
+ /**
+- * Eliminate signature/digest disablers.
++ * Signature/digest disablers.
+  */
+-#undef	SUPPORT_NOSIGNATURES
++#define SUPPORT_NOSIGNATURES 1
+ 
+ /**
+  * Permit ar(1) payloads. Disabled while rpmio/iosm.c is under development.
+-- 
+2.9.0
+
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
index 3adb29c..d264d50 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -117,6 +117,7 @@ SRC_URI += " \
 	   file://rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch \
 	   file://0001-Disable-__sync_add_and_fetch_8-on-nios2.patch \
 	   file://gcc6-stdlib.patch \
+	   file://0001-system.h-query.c-support-nosignature.patch \
 "
 
 # OE specific changes

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list