}
static int
-undef_remove(
+undef_promote(
AttributeType *at,
- char *name )
+ char *name,
+ AttributeType *nat )
{
- AttributeDescription **u_ad;
+ AttributeDescription **u_ad, **n_ad;
+
+ /* Get to last ad on the new type */
+ for ( n_ad = &nat->sat_ad; *n_ad; n_ad = &(*n_ad)->ad_next ) ;
for ( u_ad = &at->sat_ad; *u_ad; ) {
struct berval bv;
*u_ad = (*u_ad)->ad_next;
- ch_free( tmp );
-
+ tmp->ad_next = NULL;
+ *n_ad = tmp;
+ n_ad = &tmp->ad_next;
} else {
u_ad = &(*u_ad)->ad_next;
}
}
int
-slap_ad_undef_remove(
- char *name )
+slap_ad_undef_promote(
+ char *name,
+ AttributeType *at )
{
int rc;
ldap_pvt_thread_mutex_lock( &ad_undef_mutex );
- rc = undef_remove( slap_schema.si_at_undefined, name );
+ rc = undef_promote( slap_schema.si_at_undefined, name, at );
if ( rc == 0 ) {
- rc = undef_remove( slap_schema.si_at_proxied, name );
+ rc = undef_promote( slap_schema.si_at_proxied, name, at );
}
ldap_pvt_thread_mutex_unlock( &ad_undef_mutex );
}
if ( sat->sat_oid ) {
- slap_ad_undef_remove( sat->sat_oid );
+ slap_ad_undef_promote( sat->sat_oid, sat );
}
names = sat->sat_names;
if ( names ) {
while ( *names ) {
- slap_ad_undef_remove( *names );
+ slap_ad_undef_promote( *names, sat );
names++;
}
}
const char **text,
unsigned proxied ));
-LDAP_SLAPD_F (int) slap_ad_undef_remove LDAP_P((
- char *name ));
+LDAP_SLAPD_F (int) slap_ad_undef_promote LDAP_P((
+ char *name,
+ AttributeType *nat ));
LDAP_SLAPD_F (AttributeDescription *) ad_find_tags LDAP_P((
AttributeType *type,