From 4f8940365cb6519fc8b5a785cc617ce808e11d89 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 21 Oct 2013 12:40:42 +0200 Subject: [PATCH] fix: slapd daemon fails to start with segmentation fault on s390x Resolves: #1020661 --- openldap-security-pie.patch | 16 ---------------- openldap.spec | 15 +++++++++++---- 2 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 openldap-security-pie.patch diff --git a/openldap-security-pie.patch b/openldap-security-pie.patch deleted file mode 100644 index 025c3d4..0000000 --- a/openldap-security-pie.patch +++ /dev/null @@ -1,16 +0,0 @@ -Build slapd as position-independent executable (PIE) to take an advantage of -address space layout randomization (ASLD). - -Author: Thomas Woerner - ---- a/servers/slapd/Makefile.in -+++ b/servers/slapd/Makefile.in -@@ -263,7 +263,7 @@ slapi/libslapi.la: FORCE - (cd slapi; $(MAKE) $(MFLAGS) all) - - slapd: $(SLAPD_DEPENDS) @LIBSLAPI@ -- $(LTLINK) -o $@ $(SLAPD_OBJECTS) $(LIBS) \ -+ $(LTLINK) -pie -Wl,-z,defs -o $@ $(SLAPD_OBJECTS) $(LIBS) \ - $(WRAP_LIBS) - $(RM) $(SLAPTOOLS) - for i in $(SLAPTOOLS); do \ diff --git a/openldap.spec b/openldap.spec index f8a9b1c..e107764 100644 --- a/openldap.spec +++ b/openldap.spec @@ -5,7 +5,7 @@ Name: openldap Version: 2.4.36 -Release: 3%{?dist} +Release: 4%{?dist} Summary: LDAP support libraries Group: System Environment/Daemons License: OpenLDAP @@ -26,7 +26,6 @@ Source55: libexec-generate-server-cert.sh # patches for 2.4 Patch0: openldap-manpages.patch -Patch1: openldap-security-pie.patch Patch2: openldap-sql-linking.patch Patch3: openldap-reentrant-gethostby.patch Patch4: openldap-smbk5pwd-overlay.patch @@ -152,7 +151,6 @@ ln -s %{_includedir}/nspr4 include/nspr AUTOMAKE=%{_bindir}/true autoreconf -fi %patch0 -p1 -%patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 @@ -191,9 +189,15 @@ popd %build +%ifarch s390 s390x + export CFLAGS="-fPIE" +%else + export CFLAGS="-fpie" +%endif +export LDFLAGS="-pie" # avoid stray dependencies (linker flag --as-needed) # enable experimental support for LDAP over UDP (LDAP_CONNECTIONLESS) -export CFLAGS="%{optflags} -Wl,--as-needed -DLDAP_CONNECTIONLESS" +export CFLAGS="${CFLAGS} %{optflags} -Wl,--as-needed -DLDAP_CONNECTIONLESS" pushd openldap-%{version} %configure \ @@ -601,6 +605,9 @@ exit 0 %{_mandir}/man3/* %changelog +* Mon Oct 21 2013 Jan Synáček - 2.4.36-4 +- fix: slapd daemon fails to start with segmentation fault on s390x (#1020661) + * Tue Oct 15 2013 Jan Synáček - 2.4.36-3 - rebuilt for libdb-5.3.28