X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fadd.c;h=7824ca212b01649a61b7fbcb2cba2fad39e29a1c;hb=0a5f1e8516d386784ed7f605e5d03c7ee6d7cedd;hp=323fd00bdc989e18b25011e0e0d33fe5f0ce074e;hpb=01f7a7466bf70b552b69d6f46380ee139fbfa529;p=openldap diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 323fd00bdc..7824ca212b 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -1,10 +1,18 @@ /* $OpenLDAP$ */ -/* - * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2003 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . */ -/* - * Copyright (c) 1995 Regents of the University of Michigan. +/* Portions Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * * Redistribution and use in source and binary forms are permitted @@ -244,10 +252,10 @@ do_add( Operation *op, SlapReply *rs ) /* do the update here */ int repl_user = be_isupdate(op->o_bd, &op->o_ndn ); #ifndef SLAPD_MULTIMASTER - if ( !op->o_bd->be_syncinfo && + if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo ) && ( !op->o_bd->be_update_ndn.bv_len || repl_user )) #else - if ( !op->o_bd->be_syncinfo ) + if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) #endif { int update = op->o_bd->be_update_ndn.bv_len; @@ -328,8 +336,13 @@ do_add( Operation *op, SlapReply *rs ) } #endif /* LDAP_SLAPI */ - if ( op->o_bd->be_syncinfo ) { - defref = op->o_bd->be_syncinfo->si_provideruri_bv; + if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) { + syncinfo_t *si; + LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) { + struct berval tmpbv; + ber_dupbv( &tmpbv, &si->si_provideruri_bv[0] ); + ber_bvarray_add( &defref, &tmpbv ); + } } else { defref = op->o_bd->be_update_refs ? op->o_bd->be_update_refs : default_referral;