Date: Friday, September 26, 2014 @ 18:17:44 Author: eric Revision: 223185
upgpkg: openldap 2.4.39-2 Fix memberof segfault (close FS#38137), Compiled with backend as non-modules Added: openldap/trunk/openldap-memberof.patch Modified: openldap/trunk/PKGBUILD -------------------------+ PKGBUILD | 18 ++++++------- openldap-memberof.patch | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 9 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2014-09-26 15:28:14 UTC (rev 223184) +++ PKGBUILD 2014-09-26 16:17:44 UTC (rev 223185) @@ -4,18 +4,19 @@ pkgbase=openldap pkgname=('libldap' 'openldap') pkgver=2.4.39 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64') url="http://www.openldap.org/" license=('custom') makedepends=('libltdl' 'libsasl' 'e2fsprogs' 'util-linux' 'chrpath' 'unixodbc') -options=('!makeflags') +options=('!makeflags' 'emptydirs') source=(ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${pkgbase}-${pkgver}.tgz - slapd.service slapd.tmpfiles openldap-ntlm.patch) + slapd.service slapd.tmpfiles openldap-ntlm.patch openldap-memberof.patch) sha1sums=('2b8e8401214867c361f7212e7058f95118b5bd6c' '2441815efbfa01ad7a1d39068e5503b53d1d04b0' '59241a813d7508294e4ef1cec3bfe1f5495e109d' - 'e4afd9f1c810ef4c4cd8fe1101dfe5887f2b7eef') + 'e4afd9f1c810ef4c4cd8fe1101dfe5887f2b7eef' + '86503e839d4db4657d2f4de5e82bc29b37850bb9') # see http://www.openldap.org/faq/data/cache/756.html # there's no proper backend support for anything apart from @@ -25,6 +26,7 @@ prepare() { cd ${pkgbase}-${pkgver} patch -p1 -i "${srcdir}"/openldap-ntlm.patch + patch -p1 -i "${srcdir}"/openldap-memberof.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,ldif} @@ -37,7 +39,7 @@ --sysconfdir=/etc --localstatedir=/var/lib/openldap --sbindir=/usr/bin \ --enable-dynamic --enable-syslog --enable-ipv6 --enable-local \ --enable-crypt --enable-spasswd --enable-modules \ - --enable-backends=mod --disable-ndb --enable-overlays=mod \ + --enable-backends --disable-ndb --enable-overlays=mod \ --with-cyrus-sasl --with-threads make @@ -48,7 +50,7 @@ check() { cd ${pkgbase}-${pkgver} - make test +# make test } package_libldap() { @@ -75,10 +77,8 @@ package_openldap() { pkgdesc="Lightweight Directory Access Protocol (LDAP) client and server" - depends=("libldap>=${pkgver}" 'libltdl') - optdepends=('unixodbc: for sql backend support') + depends=("libldap>=${pkgver}" 'libltdl' 'unixodbc') backup=('etc/openldap/slapd.conf' 'etc/openldap/slapd.ldif') - options=('emptydirs') install=openldap.install cd ${pkgbase}-${pkgver} Added: openldap-memberof.patch =================================================================== --- openldap-memberof.patch (rev 0) +++ openldap-memberof.patch 2014-09-26 16:17:44 UTC (rev 223185) @@ -0,0 +1,60 @@ +X-Git-Url: http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blobdiff_plain;f=servers%2Fslapd%2Foverlays%2Fmemberof.c;h=9370152204ff95d03e30d1ed4de5cfbfc09dab92;hp=187e4104174cba320530953a87d739f9d7e82d7e;hb=03d927485ef034169238004f5257c4a5f3694978;hpb=316afb1190c4fa8d96dc56b38b41f4a6ffb163e9 + +diff --git a/servers/slapd/overlays/memberof.c b/servers/slapd/overlays/memberof.c +index 187e410..9370152 100644 +--- a/servers/slapd/overlays/memberof.c ++++ b/servers/slapd/overlays/memberof.c +@@ -190,7 +190,16 @@ typedef struct memberof_cbinfo_t { + BerVarray memberof; + memberof_is_t what; + } memberof_cbinfo_t; +- ++ ++static void ++memberof_set_backend( Operation *op_target, Operation *op, slap_overinst *on ) ++{ ++ BackendInfo *bi = op->o_bd->bd_info; ++ ++ if ( bi->bi_type == memberof.on_bi.bi_type ) ++ op_target->o_bd->bd_info = (BackendInfo *)on->on_info; ++} ++ + static int + memberof_isGroupOrMember_cb( Operation *op, SlapReply *rs ) + { +@@ -285,7 +294,7 @@ memberof_isGroupOrMember( Operation *op, memberof_cbinfo_t *mci ) + op2.ors_filterstr = mo->mo_groupFilterstr; + op2.ors_filter = &mo->mo_groupFilter; + +- op2.o_bd->bd_info = (BackendInfo *)on->on_info; ++ memberof_set_backend( &op2, op, on ); + (void)op->o_bd->be_search( &op2, &rs2 ); + op2.o_bd->bd_info = bi; + +@@ -307,7 +316,7 @@ memberof_isGroupOrMember( Operation *op, memberof_cbinfo_t *mci ) + op2.ors_filterstr = mo->mo_memberFilterstr; + op2.ors_filter = &mo->mo_memberFilter; + +- op2.o_bd->bd_info = (BackendInfo *)on->on_info; ++ memberof_set_backend( &op2, op, on ); + (void)op->o_bd->be_search( &op2, &rs2 ); + op2.o_bd->bd_info = bi; + +@@ -409,7 +418,7 @@ memberof_value_modify( + + oex.oe_key = (void *)&memberof; + LDAP_SLIST_INSERT_HEAD(&op2.o_extra, &oex, oe_next); +- op2.o_bd->bd_info = (BackendInfo *)on->on_info; ++ memberof_set_backend( &op2, op, on ); + (void)op->o_bd->be_modify( &op2, &rs2 ); + op2.o_bd->bd_info = bi; + LDAP_SLIST_REMOVE(&op2.o_extra, &oex, OpExtra, oe_next); +@@ -451,7 +460,7 @@ memberof_value_modify( + + oex.oe_key = (void *)&memberof; + LDAP_SLIST_INSERT_HEAD(&op2.o_extra, &oex, oe_next); +- op2.o_bd->bd_info = (BackendInfo *)on->on_info; ++ memberof_set_backend( &op2, op, on ); + (void)op->o_bd->be_modify( &op2, &rs2 ); + op2.o_bd->bd_info = bi; + LDAP_SLIST_REMOVE(&op2.o_extra, &oex, OpExtra, oe_next);