]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/modify.c
Notices and acknowledgements
[openldap] / servers / slapd / back-ldbm / modify.c
index bed5eefd8e7e6d2926bff401c86c9ef8a2219092..0823ec072d9d9e0b4b7c76f4063fc4b8940ce050 100644 (file)
@@ -324,10 +324,19 @@ ldbm_back_modify(
                                : NULL;
                        cache_return_entry_r( &li->li_cache, matched );
                } else {
-                       BerVarray deref = op->o_bd->be_syncinfo ?
-                               op->o_bd->be_syncinfo->si_provideruri_bv : default_referral;
+                       BerVarray deref = NULL;
+                       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( &deref, &tmpbv );
+                               }
+                       } else {
+                               deref = default_referral;
+                       }
                        rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
-                               LDAP_SCOPE_DEFAULT );
+                                                       LDAP_SCOPE_DEFAULT );
                }
 
                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);