bdb_delete( Operation *op, SlapReply *rs )
{
struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
- Entry *matched;
+ Entry *matched = NULL;
struct berval pdn = {0, NULL};
Entry *e = NULL;
Entry *p = NULL;
}
}
+#ifdef LDAP_SYNCREPL
+ if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
+#else
if ( e == NULL ) {
+#endif
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"<=- bdb_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0);
op->o_req_dn.bv_val, 0, 0);
#endif
+#ifdef LDAP_SYNCREPL
+ if ( e == NULL && matched != NULL && !is_entry_glue( matched )) {
+#else
if ( matched != NULL ) {
+#endif
rs->sr_matched = ch_strdup( matched->e_dn );
rs->sr_ref = is_entry_referral( matched )
? get_entry_referrals( op, matched )
matched = NULL;
} else {
- rs->sr_ref = referral_rewrite( default_referral,
- NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+#ifdef LDAP_SYNCREPL
+ BerVarray deref = op->o_bd->syncinfo ?
+ op->o_bd->syncinfo->masteruri_bv : default_referral;
+#else
+ BerVarray deref = default_referral;
+#endif
+ rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
rs->sr_err = LDAP_REFERRAL;
"<=- bdb_delete: entry is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
- "bdb_delete: entry is referral\n",
- 0, 0, 0 );
+ "bdb_delete: entry is referral\n", 0, 0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
e = ei->bei_e;
/* acquire and lock entry */
+#ifdef LDAP_SYNCREPL
+ if ( rs->sr_err == DB_NOTFOUND || !e ||
+ ( !manageDSAit && is_entry_glue( e ))) {
+ if ( e != NULL && !is_entry_glue( e )) {
+#else
if ( rs->sr_err == DB_NOTFOUND ) {
if ( e != NULL ) {
+#endif
rs->sr_matched = ch_strdup( e->e_dn );
rs->sr_ref = is_entry_referral( e )
? get_entry_referrals( op, e )
e = NULL;
} else {
- rs->sr_ref = referral_rewrite( default_referral,
- NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+#ifdef LDAP_SYNCREPL
+ BerVarray deref = op->o_bd->syncinfo ?
+ op->o_bd->syncinfo->masteruri_bv : default_referral;
+#else
+ BerVarray deref = default_referral;
+#endif
+ rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
rs->sr_err = LDAP_REFERRAL;
}
e = ei->bei_e;
+#ifdef LDAP_SYNCREPL
+ if ( rs->sr_err == DB_NOTFOUND || !e ||
+ ( !manageDSAit && is_entry_glue( e ))) {
+ if( e != NULL && !is_entry_glue( e )) {
+#else
if ( rs->sr_err == DB_NOTFOUND ) {
if( e != NULL ) {
+#endif
rs->sr_matched = ch_strdup( e->e_dn );
rs->sr_ref = is_entry_referral( e )
? get_entry_referrals( op, e )
e = NULL;
} else {
- rs->sr_ref = referral_rewrite( default_referral,
- NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+#ifdef LDAP_SYNCREPL
+ BerVarray deref = op->o_bd->syncinfo ?
+ op->o_bd->syncinfo->masteruri_bv : default_referral;
+#else
+ BerVarray deref = default_referral;
+#endif
+ rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
rs->sr_err = LDAP_REFERRAL;
if ( ei ) e = ei->bei_e;
- if( e == NULL ) {
+#ifdef LDAP_SYNCREPL
+ if ( e == NULL || is_entry_glue( e )) {
+#else
+ if ( e == NULL ) {
+#endif
rs->sr_text = "could not locate authorization entry";
rc = LDAP_NO_SUCH_OBJECT;
goto done;
aoc->a_vals[0].bv_val );
return LDAP_OBJECT_CLASS_VIOLATION;
+#ifdef LDAP_SYNCREPL
+ } else if ( sc != slap_schema.si_oc_glue && sc != oc ) {
+#else
} else if ( sc != oc ) {
+#endif
snprintf( textbuf, textlen,
"structural object class modification "
"from '%s' to '%s' not allowed",
asc->a_vals[0].bv_val, nsc.bv_val );
return LDAP_NO_OBJECT_CLASS_MODS;
}
+#ifdef LDAP_SYNCREPL
+ else if ( sc == slap_schema.si_oc_glue ) {
+ sc = oc;
+ }
+#endif
/* naming check */
#ifdef LDAP_SYNCREPL