From 0ee322918d675ba63469ee487c098a90744b9f35 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 13 May 2004 22:58:00 +0000 Subject: [PATCH] import empty DN uniqueMember normalization from HEAD --- CHANGES | 1 + servers/slapd/schema_init.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index e2b56870bd..1978fdf42b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ OpenLDAP 2.2 Change Log OpenLDAP 2.2.12 Engineering + Fixed slapd empty DN uniqueMember normalization Fixed slapd empty DN in proxyAuthx control Fixed slapd parsing of auth{cz} "dn:" rules Fixed slapd set acl recursion (ITS#3140) diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 62ed895884..4f8bd63c68 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -873,8 +873,11 @@ uniqueMemberNormalize( assert( SLAP_MR_IS_VALUE_OF_SYNTAX( usage )); - ber_dupbv( &out, val ); - if( out.bv_len != 0 ) { + ber_dupbv_x( &out, val, ctx ); + if( BER_BVISEMPTY( &out ) ) { + *normalized = out; + + } else { struct berval uid = BER_BVNULL; if( out.bv_val[out.bv_len-1] == 'B' @@ -884,7 +887,7 @@ uniqueMemberNormalize( uid.bv_val = strrchr( out.bv_val, '#' ); if( uid.bv_val == NULL ) { - free( out.bv_val ); + sl_free( out.bv_val, ctx ); return LDAP_INVALID_SYNTAX; } @@ -898,7 +901,7 @@ uniqueMemberNormalize( rc = dnNormalize( 0, NULL, NULL, &out, normalized, ctx ); if( rc != LDAP_SUCCESS ) { - free( out.bv_val ); + sl_free( out.bv_val, ctx ); return LDAP_INVALID_SYNTAX; } @@ -918,7 +921,7 @@ uniqueMemberNormalize( normalized->bv_val[normalized->bv_len] = '\0'; } - free( out.bv_val ); + sl_free( out.bv_val, ctx ); } return LDAP_SUCCESS; -- 2.39.5