]> git.sur5r.net Git - openldap/commitdiff
more attribute values mucking
authorPierangelo Masarati <ando@openldap.org>
Tue, 8 Jan 2008 17:02:37 +0000 (17:02 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 8 Jan 2008 17:02:37 +0000 (17:02 +0000)
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/log.c

index 0abd45c193747fc43ca79c31ce4424f3eed90219..bc9858ab9b2891f15aebc92305138c118f00f98b 100644 (file)
@@ -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 );
+                               }
                        }
                }
 
index c1ba52cbbaa88c4243de0fc776759387c3981d87..a1f9dade2d7c6e944a20edb91aee2b8ff72da794 100644 (file)
@@ -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;