From da801e3db069d60a2f6684d89c86b5f333379d16 Mon Sep 17 00:00:00 2001 From: Gavin Henry Date: Wed, 14 Nov 2007 18:05:07 +0000 Subject: [PATCH] addpartial overlay update for 2.4.6 (ITS#3593) --- contrib/slapd-modules/addpartial/Makefile | 4 ++-- contrib/slapd-modules/addpartial/README | 8 +++---- .../addpartial/addpartial-overlay.c | 21 ++++++++----------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/contrib/slapd-modules/addpartial/Makefile b/contrib/slapd-modules/addpartial/Makefile index 60a1b592ca..584be6f1b4 100644 --- a/contrib/slapd-modules/addpartial/Makefile +++ b/contrib/slapd-modules/addpartial/Makefile @@ -1,6 +1,6 @@ -OPENLDAP_SRC=/usr/local/src/openldap-2.3.32 +OPENLDAP_SRC=/usr/local/src/openldap-2.4.6 CPPFLAGS+=-I${OPENLDAP_SRC}/include -I${OPENLDAP_SRC}/servers/slapd -LDFLAGS+=-L/usr/local/openldap-2.3.32/lib +LDFLAGS+=-L/usr/local/openldap-2.4.6 CC=gcc all: addpartial-overlay.so diff --git a/contrib/slapd-modules/addpartial/README b/contrib/slapd-modules/addpartial/README index dca8b141bd..fea67d1659 100644 --- a/contrib/slapd-modules/addpartial/README +++ b/contrib/slapd-modules/addpartial/README @@ -16,11 +16,9 @@ DESCRIPTION in the entry in the slapd DB, a replace will be done with an empty list of values). - Once a modify takes place, the addpartial overlay will write changes to the - replog (using the slap_replog_cb). If you are using syncrepl for - replication, the syncprov overlay will properly process the change, provided - that addpartial is the first overlay to run. Please see the CAVEATS for - more specifics about this. + Once a modify takes place, the syncprov overlay will properly process the + change, provided that addpartial is the first overlay to run. Please see + the CAVEATS for more specifics about this. The addpartial overlay makes it easy to replicate full entries to a slapd instance without worrying about the differences between entries or even if diff --git a/contrib/slapd-modules/addpartial/addpartial-overlay.c b/contrib/slapd-modules/addpartial/addpartial-overlay.c index 92100405bd..630a30edff 100644 --- a/contrib/slapd-modules/addpartial/addpartial-overlay.c +++ b/contrib/slapd-modules/addpartial/addpartial-overlay.c @@ -1,5 +1,5 @@ /** - * $Id: addpartial-overlay.c 5376 2007-01-26 20:03:13Z dhawes $ + * $Id: addpartial-overlay.c 6588 2007-11-07 18:29:25Z dhawes $ * * Copyright (C) 2004 Virginia Tech, David Hawes. * All rights reserved. @@ -16,8 +16,8 @@ * * Author: David H. Hawes, Jr. * Email: dhawes@vt.edu - * Version: $Revision: 5376 $ - * Updated: $Date: 2007-01-26 15:03:13 -0500 (Fri, 26 Jan 2007) $ + * Version: $Revision: 6588 $ + * Updated: $Date: 2007-11-07 13:29:25 -0500 (Wed, 07 Nov 2007) $ * * addpartial-overlay * @@ -31,12 +31,7 @@ */ #include "portable.h" -#include -#include -#include #include "slap.h" -#include -#include static int addpartial_search_cb( Operation *op, SlapReply *rs); static int collect_error_msg_cb( Operation *op, SlapReply *rs); @@ -159,6 +154,7 @@ static int addpartial_add( Operation *op, SlapReply *rs) mod->sml_type.bv_len = strlen(mod->sml_type.bv_val); mod->sml_values = attr->a_vals; mod->sml_nvalues = attr->a_nvals; + mod->sml_numvals = attr->a_numvals; *modtail = mod; modtail = &mod->sml_next; } @@ -198,6 +194,7 @@ static int addpartial_add( Operation *op, SlapReply *rs) mod->sml_type.bv_len = strlen(mod->sml_type.bv_val); mod->sml_values = attr->a_vals; mod->sml_nvalues = attr->a_nvals; + mod->sml_numvals = attr->a_numvals; *modtail = mod; modtail = &mod->sml_next; continue; @@ -253,6 +250,7 @@ static int addpartial_add( Operation *op, SlapReply *rs) mod->sml_type.bv_len = strlen(mod->sml_type.bv_val); mod->sml_values = attr->a_vals; mod->sml_nvalues = attr->a_nvals; + mod->sml_numvals = attr->a_numvals; *modtail = mod; modtail = &mod->sml_next; break; @@ -285,6 +283,7 @@ static int addpartial_add( Operation *op, SlapReply *rs) mod->sml_type.bv_len = strlen(mod->sml_type.bv_val); mod->sml_values = NULL; mod->sml_nvalues = NULL; + mod->sml_numvals = 0; *modtail = mod; modtail = &mod->sml_next; } @@ -305,7 +304,6 @@ static int addpartial_add( Operation *op, SlapReply *rs) { Modifications *m = NULL; int modcount; - slap_callback cb2 = { NULL, slap_replog_cb, NULL, NULL }; slap_callback nullcb = { NULL, collect_error_msg_cb, NULL, NULL }; char textbuf[SLAP_TEXT_BUFLEN]; @@ -319,8 +317,7 @@ static int addpartial_add( Operation *op, SlapReply *rs) nop.o_tag = LDAP_REQ_MODIFY; nop.orm_modlist = mods; - cb2.sc_next = &nullcb; - nop.o_callback = &cb2; + nop.o_callback = &nullcb; nop.o_bd->bd_info = (BackendInfo *) on->on_info; for(m = mods, modcount = 0; m; m = m->sml_next, @@ -372,7 +369,7 @@ static int addpartial_add( Operation *op, SlapReply *rs) addpartial.on_bi.bi_type, 0, 0); } - if(found != NULL) ; + if(found != NULL) entry_free(found); } else -- 2.39.5