From f63ec3f49740bc64179442226c00752a7da6d4a7 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 8 Jan 2008 17:02:37 +0000 Subject: [PATCH] more attribute values mucking --- servers/slapd/back-monitor/database.c | 8 ++++++++ servers/slapd/back-monitor/log.c | 3 +++ 2 files changed, 11 insertions(+) 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; -- 2.39.5