if ( sop->o_req_ndn.bv_len == 0 ) {
/* DIT root special case */
e = (Entry *) &slap_entry_root;
- rs->sr_err = 0;
+ rs->sr_err = LDAP_SUCCESS;
} else {
dn2entry_retry:
/* get entry with reader lock */
NULL, &sop->o_req_dn, sop->oq_search.rs_scope );
}
- rs->sr_err=LDAP_REFERRAL;
+ rs->sr_err = LDAP_REFERRAL;
rs->sr_matched = matched_dn.bv_val;
send_ldap_result( sop, rs );
} else if ( limit->lms_t_hard > 0 ) {
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
send_ldap_result( sop, rs );
- rs->sr_err = 0;
+ rs->sr_err = LDAP_SUCCESS;
goto done;
}
} else if ( limit->lms_s_hard > 0 ) {
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
send_ldap_result( sop, rs );
- rs->sr_err = 0;
+ rs->sr_err = LDAP_SUCCESS;
goto done;
}
#endif
rs->sr_err = LDAP_SUCCESS;
+ rs->sr_entry = NULL;
send_ldap_result( sop, rs );
- rs->sr_err = 1;
goto done;
}
if ( BDB_IDL_N(candidates) > (unsigned) limit->lms_s_unchecked ) {
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
send_ldap_result( sop, rs );
- rs->sr_err = 1;
+ rs->sr_err = LDAP_SUCCESS;
goto done;
}
}
#endif
send_pagerequest_response( sop, rs, lastid, 0 );
- rs->sr_err = 1;
+ rs->sr_err = LDAP_OTHER;
goto done;
}
goto loop_begin;
loop_begin:
/* check for abandon */
if ( sop->o_abandon ) {
- rs->sr_err = 0;
+ rs->sr_err = LDAP_SUCCESS;
goto done;
}
rs->sr_err = LDAP_CANCELLED;
send_ldap_result( sop, rs );
sop->o_cancel = SLAP_CANCEL_ACK;
- rs->sr_err = 0;
+ rs->sr_err = LDAP_SUCCESS;
goto done;
}
#endif
rs->sr_err = LDAP_TIMELIMIT_EXCEEDED;
rs->sr_ref = rs->sr_v2ref;
send_ldap_result( sop, rs );
+ rs->sr_err = LDAP_SUCCESS;
goto done;
}
goto id2entry_retry;
}
- if ( ei && rs->sr_err == 0 ) {
+ if ( ei && rs->sr_err == LDAP_SUCCESS ) {
e = ei->bei_e;
} else {
e = NULL;
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
rs->sr_ref = rs->sr_v2ref;
send_ldap_result( sop, rs );
+ rs->sr_err = LDAP_SUCCESS;
goto done;
}
} else if ( ps_type == LDAP_PSEARCH_BY_SCOPEOUT )
entry_sync_state = LDAP_SYNC_DELETE;
else {
- rs->sr_err = 1;
+ rs->sr_err = LDAP_OTHER;
goto done;
}
rs->sr_err = bdb_build_sync_state_ctrl( sop,
rs->sr_err = LDAP_SUCCESS;
send_ldap_result( op, rs );
- rc = LDAP_OTHER;
+ rc = LDAP_SUCCESS;
goto done;
}
if ( ID_BLOCK_NIDS( candidates ) > (unsigned) limit->lms_s_unchecked ) {
send_ldap_error( op, rs, LDAP_ADMINLIMIT_EXCEEDED,
NULL );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
}
send_ldap_error( op, rs,
LDAP_ADMINLIMIT_EXCEEDED,
NULL );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
send_ldap_error( op, rs,
LDAP_ADMINLIMIT_EXCEEDED,
NULL );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
/* check for abandon */
if ( op->o_abandon ) {
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
if ( op->oq_search.rs_tlimit != -1 && slap_get_time() > stoptime ) {
rs->sr_err = LDAP_TIMELIMIT_EXCEEDED;
send_ldap_result( op, rs );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
cache_return_entry_r( &li->li_cache, e );
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
send_ldap_result( op, rs );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
break;
case -1: /* connection closed */
cache_return_entry_r( &li->li_cache, e );
- rc = 0;
+ rc = LDAP_SUCCESS;
goto done;
}
}
rs->sr_ref = rs->sr_v2ref;
send_ldap_result( op, rs );
- rc = 0;
+ rc = LDAP_SUCCESS;
done:
ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
cb.sc_response = dn_callback;
cb.sc_private = si;
+ si->syncUUID_ndn = NULL;
+
rc = be->be_search( op, &rs );
ch_free( op->o_req_dn.bv_val );
op->o_req_ndn = e->e_nname;
rc = be->be_modify( op, &rs );
si->e = NULL;
+ if ( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR,
+ "syncrepl_entry : be_modify failed (%d)\n",
+ rc, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "syncrepl_entry : be_modify failed (%d)\n",
+ rc, 0, 0 );
+#endif
+ return 1;
+ }
return 0;
} else if ( rc == LDAP_REFERRAL ||
rc == LDAP_NO_SUCH_OBJECT ) {
} else {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
- "be_modify failed (%d)\n",
+ "syncrepl_entry : be_add failed (%d)\n",
rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
- "be_modify failed (%d)\n",
+ "syncrepl_entry : be_add failed (%d)\n",
rc, 0, 0 );
#endif
si->e = NULL;
} else {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
- "be_modify/be_delete failed (%d)\n", rc, 0, 0 );
+ "syncrepl_entry : be_search failed (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
- "be_modify/be_delete failed (%d)\n", rc, 0, 0 );
+ "syncrepl_entry : be_search failed (%d)\n", rc, 0, 0 );
#endif
si->e = NULL;
return 1;
default :
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
- "unknown syncstate\n", 0, 0, 0 );
+ "syncrepl_entry : unknown syncstate\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
- "unknown syncstate\n", 0, 0, 0 );
+ "syncrepl_entry : unknown syncstate\n", 0, 0, 0 );
#endif
return 1;
}
)
{
syncinfo_t *si = op->o_callback->sc_private;
-
+
if ( rs->sr_type == REP_SEARCH ) {
- si->syncUUID_ndn = ber_dupbv( NULL, &rs->sr_entry->e_nname );
+ if ( si->syncUUID_ndn != NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR,
+ "dn_callback : multiple entries match dn\n", 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "dn_callback : multiple entries match dn\n", 0, 0, 0 );
+#endif
+ } else {
+ if ( rs->sr_entry == NULL ) {
+ si->syncUUID_ndn = NULL;
+ } else {
+ si->syncUUID_ndn = ber_dupbv( NULL, &rs->sr_entry->e_nname );
+ }
+ }
}
return LDAP_SUCCESS;