[arch-commits] Commit in openldap/trunk (PKGBUILD mutex-end-of-struct-sigsegv.patch)

Dan McGee dan at archlinux.org
Tue Jan 24 23:42:32 UTC 2012


    Date: Tuesday, January 24, 2012 @ 18:42:32
  Author: dan
Revision: 147237

Prep for rebuild without libfetch

Also fix upstream issues #7118 and #7133 with a patch while we are at it here,
which cause segfaults left and right in the test suite when it runs due to the
SIGHUP sent to slapd.

Added:
  openldap/trunk/mutex-end-of-struct-sigsegv.patch
Modified:
  openldap/trunk/PKGBUILD

-----------------------------------+
 PKGBUILD                          |   18 +++++--
 mutex-end-of-struct-sigsegv.patch |   85 ++++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-01-24 23:31:40 UTC (rev 147236)
+++ PKGBUILD	2012-01-24 23:42:32 UTC (rev 147237)
@@ -4,21 +4,26 @@
 pkgbase=openldap
 pkgname=('libldap' 'openldap')
 pkgver=2.4.28
-pkgrel=2
+pkgrel=3
 arch=('i686' 'x86_64')
 url="http://www.openldap.org/"
 license=('custom')
-makedepends=('libfetch' 'libltdl' 'libsasl' 'e2fsprogs' 'util-linux')
+makedepends=('libltdl' 'libsasl' 'e2fsprogs' 'util-linux')
 source=(ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${pkgbase}-${pkgver}.tgz
-        slapd slapd.default ntlm.patch)
+        slapd slapd.default
+        ntlm.patch
+        mutex-end-of-struct-sigsegv.patch)
 sha1sums=('d888beae1723002a5a2ff5509d3040df40885774'
           'bd1ea19256d3d467f1f803e0f4046ef50f17628f'
           'd89b8a533045123f1ab46c9c430cf132d58a20a4'
-          'e4afd9f1c810ef4c4cd8fe1101dfe5887f2b7eef')
+          'e4afd9f1c810ef4c4cd8fe1101dfe5887f2b7eef'
+          '7ca90dbe53c4207a2dee976359b8c6663e582d00')
 
 build() {
   cd "${srcdir}"/${pkgbase}-${pkgver}
   patch -Np1 -i "${srcdir}"/ntlm.patch
+  patch -Np1 -i "${srcdir}"/mutex-end-of-struct-sigsegv.patch
+
   sed -i 's|-m 644 $(LIBRARY)|-m 755 $(LIBRARY)|' libraries/{liblber,libldap,libldap_r}/Makefile.in
   sed -i 's|#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "ldapi"|#define LDAPI_SOCK LDAP_DIRSEP "run" LDAP_DIRSEP "openldap" LDAP_DIRSEP "ldapi"|' include/ldap_defaults.h
   sed -i 's|%LOCALSTATEDIR%/run|/run/openldap|' servers/slapd/slapd.conf
@@ -30,7 +35,8 @@
     --enable-ipv6 --enable-syslog --enable-local \
     --enable-bdb --enable-hdb \
     --enable-crypt --enable-dynamic \
-    --with-threads  --disable-wrappers \
+    --with-threads --disable-wrappers \
+    --without-fetch \
     --enable-spasswd --with-cyrus-sasl \
     --enable-overlays=mod --enable-modules=yes
   make
@@ -43,7 +49,7 @@
 
 package_libldap() {
   pkgdesc="Lightweight Directory Access Protocol (LDAP) client libraries"
-  depends=('libsasl' 'libfetch' 'e2fsprogs')
+  depends=('libsasl' 'e2fsprogs')
   backup=('etc/openldap/ldap.conf')
   options=('!libtool')
 

Added: mutex-end-of-struct-sigsegv.patch
===================================================================
--- mutex-end-of-struct-sigsegv.patch	                        (rev 0)
+++ mutex-end-of-struct-sigsegv.patch	2012-01-24 23:42:32 UTC (rev 147237)
@@ -0,0 +1,85 @@
+From 270ef33acf18dc13bfd07f8a8e66b446f80e7d27 Mon Sep 17 00:00:00 2001
+From: Howard Chu <hyc at openldap.org>
+Date: Tue, 24 Jan 2012 13:32:52 -0800
+Subject: [PATCH 1/1] ITS#7118, #7133 tentative fix
+
+Move mutexes to end of structs, so libldap can ignore them
+---
+ libraries/libldap/ldap-int.h |   40 ++++++++++++++++++++--------------------
+ 1 files changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h
+index f8e6126..6b33bcd 100644
+--- a/libraries/libldap/ldap-int.h
++++ b/libraries/libldap/ldap-int.h
+@@ -185,13 +185,6 @@ struct ldapoptions {
+ #define LDAP_TRASHED_SESSION	0xFF
+ 	int   ldo_debug;
+ 
+-#ifdef LDAP_R_COMPILE
+-	ldap_pvt_thread_mutex_t	ldo_mutex;
+-#define LDAP_LDO_MUTEX_NULLARG	, LDAP_PVT_MUTEX_NULL
+-#else
+-#define LDAP_LDO_MUTEX_NULLARG
+-#endif
+-
+ #ifdef LDAP_CONNECTIONLESS
+ #define	LDAP_IS_UDP(ld)		((ld)->ld_options.ldo_is_udp)
+ 	void*			ldo_peer;	/* struct sockaddr* */
+@@ -281,6 +274,13 @@ struct ldapoptions {
+ 	ldaplist *ldo_conn_cbs;
+ 
+ 	LDAP_BOOLEANS ldo_booleans;	/* boolean options */
++
++#ifdef LDAP_R_COMPILE
++	ldap_pvt_thread_mutex_t	ldo_mutex;
++#define LDAP_LDO_MUTEX_NULLARG	, LDAP_PVT_MUTEX_NULL
++#else
++#define LDAP_LDO_MUTEX_NULLARG
++#endif
+ };
+ 
+ 
+@@ -422,19 +422,6 @@ struct ldap_common {
+ #define	ld_requests		ldc->ldc_requests
+ #define	ld_responses		ldc->ldc_responses
+ 
+-#ifdef LDAP_R_COMPILE
+-	ldap_pvt_thread_mutex_t	ldc_msgid_mutex;
+-	ldap_pvt_thread_mutex_t	ldc_conn_mutex;
+-	ldap_pvt_thread_mutex_t	ldc_req_mutex;
+-	ldap_pvt_thread_mutex_t	ldc_res_mutex;
+-	ldap_pvt_thread_mutex_t	ldc_abandon_mutex;
+-#define	ld_msgid_mutex		ldc->ldc_msgid_mutex
+-#define	ld_conn_mutex		ldc->ldc_conn_mutex
+-#define	ld_req_mutex		ldc->ldc_req_mutex
+-#define	ld_res_mutex		ldc->ldc_res_mutex
+-#define	ld_abandon_mutex	ldc->ldc_abandon_mutex
+-#endif
+-
+ 	/* protected by abandon_mutex */
+ 	ber_len_t	ldc_nabandoned;
+ 	ber_int_t	*ldc_abandoned;	/* array of abandoned requests */
+@@ -463,6 +450,19 @@ struct ldap_common {
+ 	/* protected by ldc_mutex */
+ 	unsigned int		ldc_refcnt;
+ #define	ld_ldcrefcnt		ldc->ldc_refcnt
++
++#ifdef LDAP_R_COMPILE
++	ldap_pvt_thread_mutex_t	ldc_msgid_mutex;
++	ldap_pvt_thread_mutex_t	ldc_conn_mutex;
++	ldap_pvt_thread_mutex_t	ldc_req_mutex;
++	ldap_pvt_thread_mutex_t	ldc_res_mutex;
++	ldap_pvt_thread_mutex_t	ldc_abandon_mutex;
++#define	ld_msgid_mutex		ldc->ldc_msgid_mutex
++#define	ld_conn_mutex		ldc->ldc_conn_mutex
++#define	ld_req_mutex		ldc->ldc_req_mutex
++#define	ld_res_mutex		ldc->ldc_res_mutex
++#define	ld_abandon_mutex	ldc->ldc_abandon_mutex
++#endif
+ };
+ 
+ struct ldap {
+-- 
+1.7.4.2
+




More information about the arch-commits mailing list