From b4d1c96df4363f63ddf5643602716265d4bea2e5ce0a5d1b44633148e1b10a5e Mon Sep 17 00:00:00 2001 From: Pedro Monreal Gonzalez Date: Thu, 5 Aug 2021 13:08:37 +0000 Subject: [PATCH] Accepting request 910320 from home:pmonrealgonzalez:branches:Base:System - Fix build with glibc 2.34: [bsc#1189089] * Use glibc's closefrom. * Add gpgme-use-glibc-closefrom.patch OBS-URL: https://build.opensuse.org/request/show/910320 OBS-URL: https://build.opensuse.org/package/show/Base:System/gpgme?expand=0&rev=134 --- gpgme-use-glibc-closefrom.patch | 32 ++++++++++++++++++++++++++++++++ gpgme.changes | 7 +++++++ gpgme.spec | 5 ++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 gpgme-use-glibc-closefrom.patch diff --git a/gpgme-use-glibc-closefrom.patch b/gpgme-use-glibc-closefrom.patch new file mode 100644 index 0000000..fc6905b --- /dev/null +++ b/gpgme-use-glibc-closefrom.patch @@ -0,0 +1,32 @@ +From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001 +From: Jiri Kucera +Date: Sun, 25 Jul 2021 11:35:54 +0200 +Subject: [PATCH] core: Support closefrom also for glibc. + +* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom. +-- + +Since 2.34, glibc introduces closefrom (the implementation +follows *BSD standard). + +Signed-off-by: Werner Koch +--- + src/posix-io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/posix-io.c b/src/posix-io.c +index e712ef28..2a3a81fc 100644 +--- a/src/posix-io.c ++++ b/src/posix-io.c +@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, + if (fd_list[i].fd > fd) + fd = fd_list[i].fd; + fd++; +-#if defined(__sun) || defined(__FreeBSD__) ++#if defined(__sun) || defined(__FreeBSD__) || defined(__GLIBC__) + closefrom (fd); + max_fds = fd; + #else /*!__sun */ +-- +2.11.0 + diff --git a/gpgme.changes b/gpgme.changes index 4fcb0f8..f669e0d 100644 --- a/gpgme.changes +++ b/gpgme.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Aug 5 10:29:27 UTC 2021 - Pedro Monreal + +- Fix build with glibc 2.34: [bsc#1189089] + * Use glibc's closefrom. + * Add gpgme-use-glibc-closefrom.patch + ------------------------------------------------------------------- Wed Jul 7 18:19:43 UTC 2021 - Andreas Stieger diff --git a/gpgme.spec b/gpgme.spec index 43d4584..9d1683e 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -1,5 +1,5 @@ # -# spec file for package gpgme +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -45,6 +45,8 @@ Source3: gpgme.keyring Source99: gpgme.changes Patch0: gpgme-1.16.0-Use-after-free-in-t-edit-sign-test.patch Patch1: gpgme-1.16.0-t-various-testSignKeyWithExpiration-32-bit.patch +# PATCH-FIX-UPSTREAM bsc#1189089 Use glibc's closefrom +Patch2: gpgme-use-glibc-closefrom.patch BuildRequires: gcc-c++ BuildRequires: gpg2 >= 2.0.10 BuildRequires: libassuan-devel >= 2.4.2 @@ -209,6 +211,7 @@ This package contains the bindings to use the library in Qt C++ applications. %setup -q -n gpgme-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build build_timestamp=$(date -u +%{Y}-%{m}-%{dT}%{H}:%{M}+0000 -r %{SOURCE99})