mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
ITS#10336 slapd-mdb: fix delete on empty DB
Don't assume parent of target entry will always exist.
This commit is contained in:
parent
6063498361
commit
7a8d72b02b
1 changed files with 11 additions and 10 deletions
|
|
@ -148,17 +148,18 @@ mdb_delete( Operation *op, SlapReply *rs )
|
|||
"<=- " LDAP_XSTRING(mdb_delete) ": no such object %s\n",
|
||||
op->o_req_dn.bv_val );
|
||||
|
||||
rs->sr_matched = ch_strdup( e->e_dn );
|
||||
if ( is_entry_referral( e )) {
|
||||
BerVarray ref = get_entry_referrals( op, e );
|
||||
rs->sr_ref = referral_rewrite( ref, &e->e_name,
|
||||
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
|
||||
ber_bvarray_free( ref );
|
||||
} else {
|
||||
rs->sr_ref = NULL;
|
||||
rs->sr_ref = NULL;
|
||||
if ( e ) {
|
||||
rs->sr_matched = ch_strdup( e->e_dn );
|
||||
if ( is_entry_referral( e )) {
|
||||
BerVarray ref = get_entry_referrals( op, e );
|
||||
rs->sr_ref = referral_rewrite( ref, &e->e_name,
|
||||
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
|
||||
ber_bvarray_free( ref );
|
||||
}
|
||||
mdb_entry_return( op, e );
|
||||
e = NULL;
|
||||
}
|
||||
mdb_entry_return( op, e );
|
||||
e = NULL;
|
||||
|
||||
rs->sr_err = LDAP_REFERRAL;
|
||||
rs->sr_flags = REP_MATCHED_MUSTBEFREED | REP_REF_MUSTBEFREED;
|
||||
|
|
|
|||
Loading…
Reference in a new issue