Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 00:50:44 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r336300 - in head/net/openldap24-server: . files
Message-ID:  <201312130050.rBD0oiYj065655@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Fri Dec 13 00:50:43 2013
New Revision: 336300
URL: http://svnweb.freebsd.org/changeset/ports/336300

Log:
  Add a patch from OpenLDAP ITS 7249 [1] which addresses crash issue
  with OpenLDAP 'memberof' overlay.
  
  Pointed out by:	oshogbo
  
  [1] http://www.openldap.org/lists/openldap-bugs/201205/msg00002.html

Added:
  head/net/openldap24-server/files/patch-ITS7249   (contents, props changed)
Modified:
  head/net/openldap24-server/Makefile

Modified: head/net/openldap24-server/Makefile
==============================================================================
--- head/net/openldap24-server/Makefile	Fri Dec 13 00:43:26 2013	(r336299)
+++ head/net/openldap24-server/Makefile	Fri Dec 13 00:50:43 2013	(r336300)
@@ -56,7 +56,7 @@ BROKEN=			incompatible OpenLDAP version:
 .endif
 
 PORTREVISION_CLIENT=	0
-PORTREVISION_SERVER=	0
+PORTREVISION_SERVER=	1
 OPENLDAP_SHLIB_MAJOR=	8
 
 OPTIONS_DEFINE=	FETCH

Added: head/net/openldap24-server/files/patch-ITS7249
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/openldap24-server/files/patch-ITS7249	Fri Dec 13 00:50:43 2013	(r336300)
@@ -0,0 +1,56 @@
+--- servers/slapd/overlays/memberof.c.orig	2013-11-14 19:31:27.000000000 -0800
++++ servers/slapd/overlays/memberof.c	2013-12-12 16:44:13.000000000 -0800
+@@ -190,7 +190,16 @@
+ 	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 @@
+ 		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 @@
+ 		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 @@
+ 
+ 		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 @@
+ 
+ 		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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312130050.rBD0oiYj065655>