Bug#575900: [Pkg-openldap-devel] Bug#575900: Include autogroup contrib slapd module

2010-04-17 Thread Mathieu Parent
On Wed, Apr 14, 2010 at 11:24 PM, Matthijs Möhlmann
 wrote:
>
> Hi,
Hello

>
> I'm willing to include the autogroup contrib module but with
> openldap-2.4.21 it gives some errors.
>
> Are you able to check what's going on here ? And maybe rework the
> patches a bit ?
Great!

Attached is the svn diff of a better patch (debian/changelog not included)

thanks

Mathieu Parent
Index: debian/patches/autogroup-debian-makefile.diff
===
--- debian/patches/autogroup-debian-makefile.diff	(révision 0)
+++ debian/patches/autogroup-debian-makefile.diff	(révision 0)
@@ -0,0 +1,31 @@
+Index: b/contrib/slapd-modules/autogroup/Makefile
+===
+--- a/contrib/slapd-modules/autogroup/Makefile	(révision 1257)
 b/contrib/slapd-modules/autogroup/Makefile	(copie de travail)
+@@ -1,5 +1,6 @@
+-LIBTOOL=../../../libtool
++LIBTOOL=libtool
+ 
++CPPFLAGS+=-I../../../debian/build/include
+ CPPFLAGS+=-I../../../include -I../../../servers/slapd
+ 
+ all: autogroup.la
+@@ -10,11 +11,16 @@
+ autogroup.la:	autogroup.lo
+ 	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+ 	-rpath $(PREFIX)/lib -module -o $@ $? 
++	#Why libtool doesn't call ld, ar and ranlib?
++	ld -Bshareable -o .libs/autogroup.so.0.0.0 .libs/autogroup.o
++	ar cru .libs/autogroup.a autogroup.o
++	ranlib .libs/autogroup.a
+ 
+ clean:
+ 	rm -f autogroup.lo autogroup.la
+ 
+ install: autogroup.la
+-	mkdir -p $(PREFIX)/lib/openldap
+-	$(LIBTOOL) --mode=install cp autogroup.la $(PREFIX)/lib/openldap
++	mkdir -p $(PREFIX)/lib/ldap
++	$(LIBTOOL) --mode=install install -c autogroup.la $(PREFIX)/lib/ldap
+ 	$(LIBTOOL) --finish $(PREFIX)/lib
++
Index: debian/patches/series
===
--- debian/patches/series	(révision 1257)
+++ debian/patches/series	(copie de travail)
@@ -10,3 +10,4 @@
 getaddrinfo-is-threadsafe
 do-not-second-guess-sonames
 shutdown-issue-6322
+autogroup-debian-makefile.diff
Index: debian/rules
===
--- debian/rules	(révision 1257)
+++ debian/rules	(copie de travail)
@@ -36,6 +36,7 @@
 slapddir	:= $(CURDIR)/debian/slapd/usr/sbin
 
 MAKEVARS	:= DESTDIR=$(installdir) STRIP=
+MAKEVARS_autogroup := PREFIX=$(installdir)/usr
 
 # Include the quilt patch system.
 include /usr/share/quilt/quilt.make
@@ -105,6 +106,7 @@
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 	RESOLV_MULTI=off $(MAKE) -C $(builddir) test
 endif
+	$(MAKE) -C $(CURDIR)/contrib/slapd-modules/autogroup $(MAKEVARS_autogroup)
 	touch $@
 
 # Check all built libraries for unresolved symbols except for the libslapi
@@ -114,6 +116,7 @@
 install: install-stamp
 install-stamp: build-stamp
 	$(MAKE) -C $(builddir) $(MAKEVARS) install
+	$(MAKE) -C $(CURDIR)/contrib/slapd-modules/autogroup $(MAKEVARS_autogroup) install
 	for F in $(installdir)/usr/lib/*.so.*.*.*; do \
 	if echo "$$F" | grep -q libslapi ; then \
 	continue; \
@@ -184,6 +187,7 @@
 	dh_testdir
 	dh_testroot
 	rm -f install-stamp build-stamp configure-stamp
+	$(MAKE) -C $(CURDIR)/contrib/slapd-modules/autogroup $(MAKEVARS_autogroup) clean
 	# Update translation templates for debconf
 	debconf-updatepo
 	# Remove our stripped schema from the upstream source area.


Bug#575900: Include autogroup contrib slapd module

2010-04-14 Thread Matthijs Möhlmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I'm willing to include the autogroup contrib module but with
openldap-2.4.21 it gives some errors.

Are you able to check what's going on here ? And maybe rework the
patches a bit ?

The current svn
(http://svn.debian.org/viewsvn/pkg-openldap/openldap/trunk/) has 2.4.21
in it.

Regards,

Matthijs Mohlmann
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkvGMqkACgkQ2n1ROIkXqbCykwCfRtCfKqEDX/ErXTi6R+rlfF0g
RysAn13TFl3UTetNHziIt64Xh1oqJnzN
=7vZ7
-END PGP SIGNATURE-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#575900: Include autogroup contrib slapd module

2010-03-30 Thread Mathieu Parent
Package: slapd
Version: 2.4.17-2.1
Severity: wishlist
Tags: patch

The attached patches add support for autogroup contrib module
(which contrary to dynlist, behave correctly when searching by
attributes).


The attached patches solves this:
- autogroup.diff: upgrade to latest CVS version (should be added to
  debian/patches)
- autogroup-debian-makefile.diff: fix the build (should be added to
  debian/patches)
- debian-rules.diff: actually build during package building

I can rework the patch or send them differently (debdiff?).

I can also make the third patch more generic, accepting a list of
contrib modules to build.

Regards

Mathieu Parent

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (900, 'testing'), (300, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-4-686 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Seulement dans openldap-2.4.17-old/contrib//ldapc++: config.guess
Seulement dans openldap-2.4.17-old/contrib//ldapc++: config.sub
diff -ur openldap-2.4.17-old/contrib//slapd-modules/autogroup/autogroup.c openldap-2.4.17/contrib//slapd-modules/autogroup/autogroup.c
--- openldap-2.4.17-old/contrib//slapd-modules/autogroup/autogroup.c	2008-11-10 20:57:30.0 +0100
+++ openldap-2.4.17/contrib//slapd-modules/autogroup/autogroup.c	2010-03-30 12:04:00.0 +0200
@@ -1,7 +1,10 @@
 /* autogroup.c - automatic group overlay */
-/* $OpenLDAP: pkg/ldap/contrib/slapd-modules/autogroup/autogroup.c,v 1.2.2.2 2008/11/10 19:57:30 quanah Exp $ */
-/*
- * Copyright 2007 Michał Szulczyński.
+/* $OpenLDAP: /contrib/slapd-modules/autogroup/autogroup.c,v 1.8 2009/09/08 06:15:08 ando Exp $ */
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 2007-2009 The OpenLDAP Foundation.
+ * Portions Copyright 2007 Michał Szulczyński.
+ * Portions Copyright 2009 Howard Chu.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -12,6 +15,11 @@
  * top-level directory of the distribution or, alternatively, at
  * .
  */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Michał Szulczyński for inclusion in
+ * OpenLDAP Software.  Additional significant contributors include:
+ *   Howard Chu
+ */
 
 #include "portable.h"
 
@@ -196,8 +204,6 @@
 static int
 autogroup_member_search_cb( Operation *op, SlapReply *rs )
 {
-	slap_overinst		*on = (slap_overinst *)op->o_bd->bd_info;
-
 	assert( op->o_tag == LDAP_REQ_SEARCH );
 
 	if ( rs->sr_type == REP_SEARCH ) {
@@ -238,20 +244,13 @@
 static int
 autogroup_member_search_modify_cb( Operation *op, SlapReply *rs )
 {
-	slap_overinst		*on = (slap_overinst *)op->o_bd->bd_info;
-
 	assert( op->o_tag == LDAP_REQ_SEARCH );
 
 	if ( rs->sr_type == REP_SEARCH ) {
 		autogroup_ga_t		*agg = (autogroup_ga_t *)op->o_callback->sc_private;
 		autogroup_entry_t	*age = agg->agg_group;
-		Operation		o = *op;
 		Modifications		*modlist;
-		SlapReply		sreply = {REP_RESULT};
-		const char		*text = NULL;
-		char			textbuf[1024];
 		struct berval		vals[ 2 ], nvals[ 2 ];
-		slap_callback		cb = { NULL, slap_null_cb, NULL, NULL };
 
 		Debug(LDAP_DEBUG_TRACE, "==> autogroup_member_search_modify_cb <%s>\n",
 			rs->sr_entry ? rs->sr_entry->e_name.bv_val : "UNKNOWN_DN", 0, 0);
@@ -508,11 +507,8 @@
 static int
 autogroup_group_add_cb( Operation *op, SlapReply *rs )
 {
-	slap_overinst		*on = (slap_overinst *)op->o_bd->bd_info;
-
 	assert( op->o_tag == LDAP_REQ_SEARCH );
 
-
 	if ( rs->sr_type == REP_SEARCH ) {
 		autogroup_sc_t		*ags = (autogroup_sc_t *)op->o_callback->sc_private;
 
@@ -538,7 +534,6 @@
 	autogroup_def_t		*agd = agi->agi_def;
 	autogroup_entry_t	*age = agi->agi_entry;
 	autogroup_filter_t	*agf;
-	Attribute		*a;
 	int			rc = 0;
 
 	Debug( LDAP_DEBUG_TRACE, "==> autogroup_add_entry <%s>\n", 
@@ -652,7 +647,6 @@
 {
 	slap_overinst		*on = (slap_overinst *)op->o_bd->bd_info;
 	autogroup_info_t		*agi = (autogroup_info_t *)on->on_bi.bi_private;
-	autogroup_def_t		*agd = agi->agi_def;
 	autogroup_entry_t	*age = agi->agi_entry,
 *age_prev, *age_next;
 	autogroup_filter_t	*agf;
@@ -683,9 +677,6 @@
 			dnMatch( &match, 0, NULL, NULL, &e->e_nname, &age->age_ndn );
 
 			if ( match == 0 ) {
-autogroup_filter_t	*agf = age->age_filter,
-			*agf_next;
-
 autogroup_delete_group( agi, age );
 break;
 			}
@@ -1266,7 +1257,6 @@
 			autogroup_entry_t	*age_next, *age_prev;
 			autogroup_filter_t	*agf,
 		*agf_next;
-			struct berval		*bv;
 
 			ldap_pvt_thread_mutex_lock( &agi->agi_mutex );
 
@@ -1446,8 +1436,7 @@
 	BackendDB	*be,
 	ConfigReply	*cr )
 {
-	slap_overinst			*on = (slap_overinst *) be->bd_info,
-*on_bd;
+	slap_overinst			*on = (slap_overinst *) be->bd_info;
 	autogroup_info_t		*agi = on->on_bi.bi_private;
 	autogroup_def_t		*agd;
 	autogroup_sc_t		ags;
@@ -1458,12 +1447,13 @@
 	void*thrctx = ldap_pvt_thread_pool_context