1
0
forked from jengelh/openldap2

Accepting request 530539 from home:jengelh:branches:network:ldap

- Add openldap-r-only.dif so that openldap2's own tools also
  link against libldap_r rather than libldap.
- Make libldap equivalent to libldap_r (like Debian) to avoid
  crashes in threaded programs which unknowingly get both
  libraries inserted into their process image.
  [rh#1370065, boo#996551]

OBS-URL: https://build.opensuse.org/request/show/530539
OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=195
This commit is contained in:
Michael Ströder 2017-10-02 18:38:04 +00:00 committed by Git OBS Bridge
parent 21af7eb21b
commit 0f916505ad
3 changed files with 42 additions and 2 deletions

24
openldap-r-only.dif Normal file
View File

@ -0,0 +1,24 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2017-07-04 13:53:32.386698982 +0200
Build all own programs exclusively with libldap_r and not libldap.
References: http://bugzilla.redhat.com/1370065
References: http://bugzilla.opensuse.org/996551
---
build/top.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: openldap-2.4.45/build/top.mk
===================================================================
--- openldap-2.4.45.orig/build/top.mk
+++ openldap-2.4.45/build/top.mk
@@ -171,7 +171,7 @@ LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/libl
LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a
LDAP_L = $(LDAP_LIBLUTIL_A) \
- $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
+ $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
SLAPD_L = $(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
$(LDAP_LIBLUTIL_A) $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Oct 2 18:15:46 UTC 2017 - jengelh@inai.de
- Add openldap-r-only.dif so that openldap2's own tools also
link against libldap_r rather than libldap.
- Make libldap equivalent to libldap_r (like Debian) to avoid
crashes in threaded programs which unknowingly get both
libraries inserted into their process image.
[rh#1370065, boo#996551]
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Oct 2 13:18:54 UTC 2017 - mrueckert@suse.de Mon Oct 2 13:18:54 UTC 2017 - mrueckert@suse.de

View File

@ -60,6 +60,7 @@ Patch11: 0011-openldap-re24-its7796.patch
Patch12: 0012-ITS8051-sockdnpat.patch Patch12: 0012-ITS8051-sockdnpat.patch
Patch13: 0013-ITS-8692-let-back-sock-generate-increment-line.patch Patch13: 0013-ITS-8692-let-back-sock-generate-increment-line.patch
Patch14: 0014-ITS-8714-Send-out-EXTENDED-operation-message-from-back-sock.patch Patch14: 0014-ITS-8714-Send-out-EXTENDED-operation-message-from-back-sock.patch
Patch15: openldap-r-only.dif
Source200: %{name_ppolicy_check_module}-%{version_ppolicy_check_module}.tar.gz Source200: %{name_ppolicy_check_module}-%{version_ppolicy_check_module}.tar.gz
Source201: %{name_ppolicy_check_module}.Makefile Source201: %{name_ppolicy_check_module}.Makefile
Source202: %{name_ppolicy_check_module}.conf Source202: %{name_ppolicy_check_module}.conf
@ -186,8 +187,8 @@ OpenLDAP client utilities such as ldapadd, ldapsearch, ldapmodify.
%package devel %package devel
Summary: Libraries, Header Files and Documentation for OpenLDAP Summary: Libraries, Header Files and Documentation for OpenLDAP
Group: Development/Libraries/C and C++
# bug437293 # bug437293
Group: Development/Libraries/C and C++
%ifarch ppc64 %ifarch ppc64
Obsoletes: openldap2-devel-64bit Obsoletes: openldap2-devel-64bit
%endif %endif
@ -255,6 +256,7 @@ gzip -k %{S:203}
%patch12 -p1 %patch12 -p1
%patch13 -p1 %patch13 -p1
%patch14 -p1 %patch14 -p1
%patch15 -p1
cp %{SOURCE5} . cp %{SOURCE5} .
# Move ppolicy check module and its Makefile into openldap-2.4/contrib/slapd-modules/ # Move ppolicy check module and its Makefile into openldap-2.4/contrib/slapd-modules/
@ -359,7 +361,6 @@ install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}/%{_sysconfdir}/sasl2/slapd.conf
install -m 755 -d ${RPM_BUILD_ROOT}/var/lib/ldap install -m 755 -d ${RPM_BUILD_ROOT}/var/lib/ldap
chmod a+x ${RPM_BUILD_ROOT}/%{_libdir}/liblber.so* chmod a+x ${RPM_BUILD_ROOT}/%{_libdir}/liblber.so*
chmod a+x ${RPM_BUILD_ROOT}/%{_libdir}/libldap_r.so* chmod a+x ${RPM_BUILD_ROOT}/%{_libdir}/libldap_r.so*
chmod a+x ${RPM_BUILD_ROOT}/%{_libdir}/libldap.so*
install -m 755 %{SOURCE6} ${RPM_BUILD_ROOT}/usr/sbin/schema2ldif install -m 755 %{SOURCE6} ${RPM_BUILD_ROOT}/usr/sbin/schema2ldif
# Install ppolicy check module # Install ppolicy check module
@ -424,6 +425,11 @@ rm -f ${RPM_BUILD_ROOT}/usr/share/man/man5/slapd-tcl.5
# Remove *.la files, libtool does not handle this correct # Remove *.la files, libtool does not handle this correct
rm -f ${RPM_BUILD_ROOT}%{_libdir}/lib*.la rm -f ${RPM_BUILD_ROOT}%{_libdir}/lib*.la
# Make ldap_r the only copy in the system [rh#1370065].
# libldap.so is only for `gcc/ld -lldap`. Make no libldap-2.4.so.2.
rm -f "%{buildroot}/%{_libdir}"/libldap-2.4.so*
ln -fs libldap_r.so "%{buildroot}/%{_libdir}/libldap.so"
%pre %pre
getent group ldap >/dev/null || /usr/sbin/groupadd -g 70 -o -r ldap getent group ldap >/dev/null || /usr/sbin/groupadd -g 70 -o -r ldap
getent passwd ldap >/dev/null || /usr/sbin/useradd -r -o -g ldap -u 76 -s /bin/false -c "User for OpenLDAP" -d /var/lib/ldap ldap getent passwd ldap >/dev/null || /usr/sbin/useradd -r -o -g ldap -u 76 -s /bin/false -c "User for OpenLDAP" -d /var/lib/ldap ldap