[prev in list] [next in list] [prev in thread] [next in thread]
List: rpm-cvs
Subject: [CVS] RPM: rpm-5_4: rpm/rpmdb/ signature.c
From: "Jeff Johnson" <jbj () rpm5 ! org>
Date: 2016-02-27 20:58:00
Message-ID: 20160227205800.7CAEA63131 () rpm5 ! org
[Download RAW message or body]
RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 27-Feb-2016 21:58:00
Branch: rpm-5_4 Handle: 2016022720580000
Modified files: (Branch: rpm-5_4)
rpm/rpmdb signature.c
Log:
From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001
From: "Roy.Li" <rongqing.li@windriver.com>
Date: Tue, 11 Nov 2014 16:28:22 +0800
Subject: [PATCH] using poptParseArgvString to parse the
_gpg_check_password_cmd
Upstream-Status: Pending
Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but
strace shows that gpg_name has a quote when run _gpg_check_password,
but not when run __gpg_sign_cmd; for example, if gpg_name is "tester"
execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose",
"--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) =
0
execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor",
"--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) =
0
it can be fixed by removing the quote around %{gpg_name} when define
__gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes
space, it will not work.
%__gpg_check_password_cmd %{__gpg} \
gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so -
The poptParseArgvString function is used to parse _gpg_sign_cmd, so using
poptParseArgvString to parse __gpg_check_password_cmd to fix this issue.
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Summary:
Revision Changes Path
1.68.2.12 +1 -1 rpm/rpmdb/signature.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/rpmdb/signature.c
============================================================================
$ cvs diff -u -r1.68.2.11 -r1.68.2.12 signature.c
--- rpm/rpmdb/signature.c 19 Feb 2015 22:05:53 -0000 1.68.2.11
+++ rpm/rpmdb/signature.c 27 Feb 2016 20:58:00 -0000 1.68.2.12
@@ -537,7 +537,7 @@
(void) setenv("GNUPGHOME", gpg_path, 1);
cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL);
- rc = argvSplit(&av, cmd, NULL);
+ rc = poptParseArgvString(cmd, NULL, (const char ***)&av);
if (!rc)
rc = execve(av[0], (char *const *)av+1, environ);
@@ .
______________________________________________________________________
RPM Package Manager http://rpm5.org
CVS Sources Repository rpm-cvs@rpm5.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic