]> git.sur5r.net Git - openldap/commitdiff
don't set sm_nvalues unless required (ITS#5375)
authorPierangelo Masarati <ando@openldap.org>
Thu, 14 Feb 2008 15:15:53 +0000 (15:15 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 14 Feb 2008 15:15:53 +0000 (15:15 +0000)
servers/slapd/back-meta/search.c
servers/slapd/overlays/rwm.c

index 70437ed6a1d5d4411140be2529163188c9d7c7f7..848b6e12ae2ac2d88c082e3685b46028fd004d89 100644 (file)
@@ -2042,7 +2042,9 @@ next_attr:;
                                        mod.sm_desc = (*ap)->a_desc;
                                        mod.sm_type = mod.sm_desc->ad_cname;
                                        mod.sm_values = (*tap)->a_vals;
-                                       mod.sm_nvalues = (*tap)->a_nvals;
+                                       if ( (*tap)->a_nvals != (*tap)->a_vals ) {
+                                               mod.sm_nvalues = (*tap)->a_nvals;
+                                       }
 
                                        (void)modify_add_values( &e, &mod,
                                                /* permissive */ 1,
index 2c1c7b344d42644fc13824b9db0585cd679dcf62..5275aa57a53961a4e14d151a88ba489a5f153e51 100644 (file)
@@ -1227,7 +1227,9 @@ cleanup_attr:;
                                        mod.sm_type = mod.sm_desc->ad_cname;
                                        mod.sm_numvals = (*tap)->a_numvals;
                                        mod.sm_values = (*tap)->a_vals;
-                                       mod.sm_nvalues = (*tap)->a_nvals;
+                                       if ( (*tap)->a_nvals != (*tap)->a_vals ) {
+                                               mod.sm_nvalues = (*tap)->a_nvals;
+                                       }
 
                                        (void)modify_add_values( &e, &mod,
                                                /* permissive */ 1,
@@ -1614,6 +1616,7 @@ rwm_db_config(
                                fname, lineno, argv[ 1 ] );
                        return 1;
                }
+
        } else if ( strcasecmp( argv[0], "normalize-mapped-attrs" ) ==  0 ) {
                if ( argc !=2 ) { 
                        fprintf( stderr,