]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/add.c
#ifdef for slap_auxprop_store
[openldap] / servers / slapd / add.c
index 323fd00bdc989e18b25011e0e0d33fe5f0ce074e..7824ca212b01649a61b7fbcb2cba2fad39e29a1c 100644 (file)
@@ -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 <http://www.openldap.org/>.
+ *
+ * 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
+ * <http://www.OpenLDAP.org/license.html>.
  */
-/*
- * 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;