summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRoy.Li <rongqing.li@windriver.com>2014-11-12 09:54:56 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-20 14:08:11 +0000
commit318730be2eafe9da368f5121316888387202efb8 (patch)
treeb223ea779eea1bccf99ab32f66de0fce349bf516 /meta/recipes-devtools
parent07a31ed4d19edf7eec47cdf2a65b0dc53e2c713c (diff)
downloadpoky-318730be2eafe9da368f5121316888387202efb8.tar.gz
rpm: fix the rpm addsign function
(From OE-Core rev: d382c1541bec301468119268f4940ae15c326b1c) Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch49
-rw-r--r--meta/recipes-devtools/rpm/rpm_5.4.14.bb1
2 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
new file mode 100644
index 0000000000..23bc3361d9
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
@@ -0,0 +1,49 @@
1From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001
2From: "Roy.Li" <rongqing.li@windriver.com>
3Date: Tue, 11 Nov 2014 16:28:22 +0800
4Subject: [PATCH] using poptParseArgvString to parse the
5 _gpg_check_password_cmd
6
7Upstream-Status: Pending
8
9Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but
10strace shows that gpg_name has a quote when run _gpg_check_password,
11but not when run __gpg_sign_cmd; for example, if gpg_name is "tester"
12
13 execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose",
14 "--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) = 0
15
16 execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor",
17 "--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) = 0
18
19it can be fixed by removing the quote around %{gpg_name} when define
20__gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes
21space, it will not work.
22
23 %__gpg_check_password_cmd %{__gpg} \
24 gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so -
25
26The poptParseArgvString function is used to parse _gpg_sign_cmd, so using
27poptParseArgvString to parse __gpg_check_password_cmd to fix this issue.
28
29Signed-off-by: Roy.Li <rongqing.li@windriver.com>
30---
31 rpmdb/signature.c | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34diff --git a/rpmdb/signature.c b/rpmdb/signature.c
35index c35e0ab..016e8d1 100644
36--- a/rpmdb/signature.c
37+++ b/rpmdb/signature.c
38@@ -529,7 +529,7 @@ int rpmCheckPassPhrase(const char * passPhrase)
39 (void) setenv("GNUPGHOME", gpg_path, 1);
40
41 cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL);
42- rc = argvSplit(&av, cmd, NULL);
43+ rc = poptParseArgvString(cmd, NULL, (const char ***)&av);
44 if (!rc)
45 rc = execve(av[0], (char *const *)av+1, environ);
46
47--
481.9.1
49
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
index 6cd932d5e9..d99a300285 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.14.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -94,6 +94,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;e
94 file://rpm-disable-Wno-override-init.patch \ 94 file://rpm-disable-Wno-override-init.patch \
95 file://rpmqv_cc_b_gone.patch \ 95 file://rpmqv_cc_b_gone.patch \
96 file://rpm-realpath.patch \ 96 file://rpm-realpath.patch \
97 file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
97 " 98 "
98 99
99# Uncomment the following line to enable platform score debugging 100# Uncomment the following line to enable platform score debugging