From: Pierangelo Masarati Date: Tue, 8 Jan 2008 17:02:37 +0000 (+0000) Subject: more attribute values mucking X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~235 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f63ec3f49740bc64179442226c00752a7da6d4a7;p=openldap more attribute values mucking --- diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 0abd45c193..bc9858ab9b 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -835,6 +835,7 @@ monitor_subsys_database_modify( BER_BVZERO( &a->a_vals[ k - 1 ] ); BER_BVZERO( &a->a_nvals[ k - 1 ] ); + a->a_numvals--; } } } @@ -860,9 +861,16 @@ monitor_subsys_database_modify( BER_BVZERO( &a->a_vals[ k - 1 ] ); BER_BVZERO( &a->a_nvals[ k - 1 ] ); + a->a_numvals--; } } } + + if ( a->a_vals == NULL ) { + assert( a->a_numvals == 0 ); + + attr_delete( &e->e_attrs, mi->mi_ad_restrictedOperation ); + } } } diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index c1ba52cbba..a1f9dade2d 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -395,6 +395,7 @@ delete_values( Operation *op, Entry *e, Modification *mod, int *newlevel ) a->a_vals[ k - 1 ] = a->a_vals[ k ]; } BER_BVZERO( &a->a_vals[ k - 1 ] ); + a->a_numvals--; break; } @@ -409,6 +410,8 @@ delete_values( Operation *op, Entry *e, Modification *mod, int *newlevel ) /* if no values remain, delete the entire attribute */ if ( BER_BVISNULL( &a->a_vals[ 0 ] ) ) { + assert( a->a_numvals == 0 ); + /* should already be zero */ *newlevel = 0;