fix crash on dlclose due to atfork handler (#1680481)

Resolves: rhbz#1680481
This commit is contained in:
Joe Orton 2019-03-08 11:19:00 +00:00
parent f8b6e04bd0
commit 2589c4ef52
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,28 @@
--- libcap-ng-0.7.9/src/cap-ng.c.noatfork
+++ libcap-ng-0.7.9/src/cap-ng.c
@@ -153,15 +153,6 @@
CAPNG_NEW,
{0, 0} };
-
-/*
- * The pthread_atfork function is being made weak so that we can use it
- * if the program is linked with pthreads and not requiring it for
- * everything that uses libcap-ng.
- */
-extern int __attribute__((weak)) pthread_atfork(void (*prepare)(void),
- void (*parent)(void), void (*child)(void));
-
/*
* Reset the state so that init gets called to erase everything
*/
@@ -173,8 +164,7 @@
static void init_lib(void) __attribute__ ((constructor));
static void init_lib(void)
{
- if (pthread_atfork)
- pthread_atfork(NULL, NULL, deinit);
+ pthread_atfork(NULL, NULL, deinit);
}
static void init(void)

View File

@ -3,11 +3,12 @@
Summary: An alternate posix capabilities library
Name: libcap-ng
Version: 0.7.9
Release: 6%{?dist}
Release: 7%{?dist}
License: LGPLv2+
URL: http://people.redhat.com/sgrubb/libcap-ng
Source0: http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
Patch1: libcap-ng-0.8-permitted.patch
Patch2: libcap-ng-0.7.9-fixatfork.patch
BuildRequires: gcc
BuildRequires: kernel-headers >= 2.6.11
BuildRequires: libattr-devel
@ -49,6 +50,7 @@ lets you set the file system based capabilities.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%build
%configure --libdir=/%{_lib} --with-python=no --with-python3
@ -101,6 +103,9 @@ make check
%attr(0644,root,root) %{_mandir}/man8/*
%changelog
* Fri Mar 8 2019 Joe Orton <jorton@redhat.com> - 0.7.9-7
- fix crash on dlclose due to atfork handler (#1680481)
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild