op->o_req_dn = e->e_name;
op->o_req_ndn = e->e_nname;
rc = be->be_modify( op, &rs );
+ si->e = NULL;
+ return 0;
} else if ( rc == LDAP_REFERRAL ||
rc == LDAP_NO_SUCH_OBJECT ) {
syncrepl_add_glue( si, ld, op, e,
modlist, syncstate,
syncUUID, syncCookie);
+ si->e = NULL;
+ return 0;
} else {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"be_modify failed (%d)\n",
rc, 0, 0 );
#endif
+ si->e = NULL;
+ return 1;
}
} else {
+ si->e = NULL;
return 0;
}
} else {
Debug( LDAP_DEBUG_ANY,
"be_modify/be_delete failed (%d)\n", rc, 0, 0 );
#endif
+ si->e = NULL;
+ return 1;
}
- si->e = NULL;
- return 1;
-
case LDAP_SYNC_DELETE :
/* Already deleted */
return 1;
Entry *glue;
SlapReply rs = {REP_RESULT};
Connection *conn = op->o_conn;
+ char* ptr;
op->o_tag = LDAP_REQ_ADD;
op->o_callback = &cb;
ber_dupbv( &dn, &e->e_nname );
ber_dupbv( &pdn, &e->e_nname );
+ ptr = dn.bv_val;
while ( !be_issuffix ( be, &pdn )) {
dnParent( &dn, &pdn );
- ch_free( dn.bv_val );
- ber_dupbv( &dn, &pdn );
+ dn.bv_val = pdn.bv_val;
+ dn.bv_len = pdn.bv_len;
levels++;
}
+ ch_free( ptr );
for ( i = 0; i <= levels; i++ ) {
glue = (Entry*) ch_calloc( 1, sizeof(Entry) );
- ch_free( dn.bv_val );
- ch_free( pdn.bv_val );
+ glue->e_private = NULL;
ber_dupbv( &dn, &e->e_nname );
- ber_dupbv( &pdn, &e->e_nname );
j = levels - i;
+
+ ptr = dn.bv_val;
for ( k = 0; k < j; k++ ) {
dnParent( &dn, &pdn );
- ch_free( dn.bv_val );
- ber_dupbv( &dn, &pdn );
+ dn.bv_val = pdn.bv_val;
+ dn.bv_len = pdn.bv_len;
}
dnPrettyNormal( 0, &dn, &pdn, &ndn, op->o_tmpmemctx );
ber_dupbv( &glue->e_name, &pdn );
ber_dupbv( &glue->e_nname, &ndn );
- ch_free( dn.bv_val );
+ ch_free( ptr );
ch_free( pdn.bv_val );
ch_free( ndn.bv_val );
a = ch_calloc( 1, sizeof( Attribute ));
a->a_desc = slap_schema.si_ad_objectClass;
+
a->a_vals = ch_calloc( 3, sizeof( struct berval ));
ber_str2bv( "top", strlen("top"), 1, &a->a_vals[0] );
ber_str2bv( "glue", strlen("glue"), 1, &a->a_vals[1] );
a->a_vals[2].bv_len = 0;
a->a_vals[2].bv_val = NULL;
+
+ a->a_nvals = ch_calloc( 3, sizeof( struct berval ));
+ ber_str2bv( "top", strlen("top"), 1, &a->a_nvals[0] );
+ ber_str2bv( "glue", strlen("glue"), 1, &a->a_nvals[1] );
+ a->a_nvals[2].bv_len = 0;
+ a->a_nvals[2].bv_val = NULL;
+
a->a_next = glue->e_attrs;
glue->e_attrs = a;
a = ch_calloc( 1, sizeof( Attribute ));
a->a_desc = slap_schema.si_ad_structuralObjectClass;
+
a->a_vals = ch_calloc( 2, sizeof( struct berval ));
ber_str2bv( "glue", strlen("glue"), 1, &a->a_vals[0] );
a->a_vals[1].bv_len = 0;
a->a_vals[1].bv_val = NULL;
+
+ a->a_nvals = ch_calloc( 2, sizeof( struct berval ));
+ ber_str2bv( "glue", strlen("glue"), 1, &a->a_nvals[0] );
+ a->a_nvals[1].bv_len = 0;
+ a->a_nvals[1].bv_val = NULL;
+
a->a_next = glue->e_attrs;
glue->e_attrs = a;