From 4762d2762cc6947de072bce5e08909be27f93354e60df5c734a90951fb066348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 16 Apr 2018 16:03:52 +0000 Subject: [PATCH] Accepting request 597073 from security:privacy bsc#1089497 OBS-URL: https://build.opensuse.org/request/show/597073 OBS-URL: https://build.opensuse.org/package/show/Base:System/gpgme?expand=0&rev=94 --- 0001-core-Tweak-STATUS_FAILURE-handling.patch | 45 +++++++++++++++++++ gpgme.changes | 7 +++ gpgme.spec | 3 ++ 3 files changed, 55 insertions(+) create mode 100644 0001-core-Tweak-STATUS_FAILURE-handling.patch diff --git a/0001-core-Tweak-STATUS_FAILURE-handling.patch b/0001-core-Tweak-STATUS_FAILURE-handling.patch new file mode 100644 index 0000000..c593b1c --- /dev/null +++ b/0001-core-Tweak-STATUS_FAILURE-handling.patch @@ -0,0 +1,45 @@ +From 9aa33a99701e189d7fc0ff7322fc9e21e35b73fa Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Thu, 12 Apr 2018 20:36:30 +0200 +Subject: [PATCH] core: Tweak STATUS_FAILURE handling. + +* src/op-support.c (_gpgme_parse_failure): Ignore failures with +location "gpg-exit". +-- + +Signed-off-by: Werner Koch +--- + src/op-support.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/op-support.c b/src/op-support.c +index 817c5691..8269ce21 100644 +--- a/src/op-support.c ++++ b/src/op-support.c +@@ -398,7 +398,13 @@ _gpgme_parse_plaintext (char *args, char **filenamep) + + + /* Parse a FAILURE status line and return the error code. ARGS is +- modified to contain the location part. */ ++ * modified to contain the location part. Note that for now we ignore ++ * failure codes with a location of gpg-exit; they are too trouble ++ * some. Instead we should eventually record that error in the ++ * context and provide a function to return a fuller error ++ * description; this could then also show the location of the error ++ * (e.g. "option- parser") to make it easier for the user to detect ++ * the actual error. */ + gpgme_error_t + _gpgme_parse_failure (char *args) + { +@@ -416,6 +422,8 @@ _gpgme_parse_failure (char *args) + *where = '\0'; + + where = args; ++ if (!strcmp (where, "gpg-exit")) ++ return 0; + + return atoi (which); + } +-- +2.16.3 + diff --git a/gpgme.changes b/gpgme.changes index 519017d..4f2bb70 100644 --- a/gpgme.changes +++ b/gpgme.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 16 13:22:48 UTC 2018 - astieger@suse.com + +- bsc#1089497: Address failure handling issues when using gpg 2.2.6 + via gpgme, as used by libzypp + Add 0001-core-Tweak-STATUS_FAILURE-handling.patch + ------------------------------------------------------------------- Mon Jan 8 10:17:39 UTC 2018 - tchvatal@suse.com diff --git a/gpgme.spec b/gpgme.spec index 5fe1bb3..d8c1a1e 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -33,6 +33,8 @@ Source2: baselibs.conf Source3: gpgme.keyring # used to have a fixed timestamp Source99: %{name}.changes +# PATCH-FIX-UPSTREAM 0001-core-Tweak-STATUS_FAILURE-handling.patch bsc#1089497 +Patch0: 0001-core-Tweak-STATUS_FAILURE-handling.patch BuildRequires: gcc-c++ BuildRequires: gpg2 >= 2.0.10 BuildRequires: libassuan-devel >= 2.4.2 @@ -175,6 +177,7 @@ This package contains the bindings to use the library in Qt C++ applications. %prep %setup -q +%patch0 -p1 %build build_timestamp=$(date -u +%{Y}-%{m}-%{dT}%{H}:%{M}+0000 -r %{SOURCE99})