char txtbuf[SLAP_TEXT_BUFLEN];
size_t textlen = sizeof txtbuf;
- struct berval bdn = {0, NULL};
+ struct berval bdn = {0, NULL}, dn, ndn;
int rc;
ber_len_t len;
Debug( LDAP_DEBUG_ANY,
"syncrepl_message_to_entry : control get failed (%d)", rc, 0, 0 );
#endif
- goto done;
+ return NULL;
+ }
+
+ if ( rctrls ) {
+ BerElementBuffer berbuf;
+ BerElement *ctrl_ber;
+
+ rctrlp = *rctrls;
+ ctrl_ber = (BerElement *)&berbuf;
+ ber_init2( ctrl_ber, &rctrlp->ldctl_value, LBER_USE_DER );
+ ber_scanf( ctrl_ber, "{eo", syncstate, syncUUID );
+ if ( ber_peek_tag( ctrl_ber, &len ) == LDAP_SYNC_TAG_COOKIE ) {
+ ber_scanf( ctrl_ber, "o}", syncCookie );
+ }
+ ldap_controls_free( rctrls );
+ } else {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR,"syncrepl_message_to_entry : "
+ " rctrls absent\n", 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry :"
+ " rctrls absent\n", 0, 0, 0 );
+#endif
}
rc = ldap_get_dn_ber( ld, msg, &ber, &bdn );
return NULL;
}
+ dnPrettyNormal( NULL, &bdn, &dn, &ndn, op->o_tmpmemctx );
+ ber_dupbv( &op->o_req_dn, &dn );
+ ber_dupbv( &op->o_req_ndn, &ndn );
+ sl_free( ndn.bv_val, op->o_tmpmemctx );
+ sl_free( dn.bv_val, op->o_tmpmemctx );
+
+ if ( *syncstate == LDAP_SYNC_PRESENT || *syncstate == LDAP_SYNC_DELETE ) {
+ return NULL;
+ }
+
e = ( Entry * ) ch_calloc( 1, sizeof( Entry ) );
- dnPrettyNormal( NULL, &bdn, &e->e_name, &e->e_nname, op->o_tmpmemctx );
- ber_dupbv( &op->o_req_dn, &e->e_name );
- ber_dupbv( &op->o_req_ndn, &e->e_nname );
- sl_free( e->e_nname.bv_val, op->o_tmpmemctx );
- sl_free( e->e_name.bv_val, op->o_tmpmemctx );
e->e_name = op->o_req_dn;
e->e_nname = op->o_req_ndn;
modtail = &mod->sml_next;
}
- if ( rctrls ) {
- BerElementBuffer berbuf;
- BerElement *ctrl_ber;
-
- rctrlp = *rctrls;
- ctrl_ber = (BerElement *)&berbuf;
- ber_init2( ctrl_ber, &rctrlp->ldctl_value, LBER_USE_DER );
- ber_scanf( ctrl_ber, "{eo", syncstate, syncUUID );
- if ( ber_peek_tag( ctrl_ber, &len ) == LDAP_SYNC_TAG_COOKIE ) {
- ber_scanf( ctrl_ber, "o}", syncCookie );
- }
- ldap_controls_free( rctrls );
- } else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,"syncrepl_message_to_entry : "
- " rctrls absent\n", 0, 0, 0 );
-#else
- Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry :"
- " rctrls absent\n", 0, 0, 0 );
-#endif
- }
-
- if ( *syncstate == LDAP_SYNC_PRESENT || *syncstate == LDAP_SYNC_DELETE ) {
- rc = 1;
- goto done;
- }
-
if ( *modlist == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
rc = be->be_delete( op, &rs );
}
/* Already deleted otherwise */
- return 1;
+ return 0;
default :
#ifdef NEW_LOGGING