From: Pierangelo Masarati Date: Thu, 14 Feb 2008 15:15:53 +0000 (+0000) Subject: don't set sm_nvalues unless required (ITS#5375) X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~145 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2df4675ac3d7fca7c9f7dcb201b23d33bf946425;p=openldap don't set sm_nvalues unless required (ITS#5375) --- 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,