From: Howard Chu Date: Mon, 12 Feb 2007 01:01:01 +0000 (+0000) Subject: Fix attribute deletion X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2bdc0819b4b99f7fb7c054b8ceae0d964ff8be31;p=openldap Fix attribute deletion --- diff --git a/servers/slapd/at.c b/servers/slapd/at.c index 715477184d..4538f5b5d4 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -455,6 +455,7 @@ at_insert( /* replacing a deleted definition? */ if ( old_sat->sat_flags & SLAP_AT_DELETED ) { AttributeType tmp; + AttributeDescription *ad; /* Keep old oid, free new oid; * Keep old ads, free new ads; @@ -468,6 +469,14 @@ at_insert( tmp.sat_ad = sat->sat_ad; *sat = tmp; + /* Check for basic ad pointing at old cname */ + for ( ad = old_sat->sat_ad; ad; ad=ad->ad_next ) { + if ( ad->ad_cname.bv_val == sat->sat_cname.bv_val ) { + ad->ad_cname = old_sat->sat_cname; + break; + } + } + at_clean( sat ); at_destroy_one( air );