From 2df4675ac3d7fca7c9f7dcb201b23d33bf946425 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 14 Feb 2008 15:15:53 +0000 Subject: [PATCH] don't set sm_nvalues unless required (ITS#5375) --- servers/slapd/back-meta/search.c | 4 +++- servers/slapd/overlays/rwm.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 70437ed6a1..848b6e12ae 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -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, diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 2c1c7b344d..5275aa57a5 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -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, -- 2.39.5