extern char * parse_numericoid(const char **sp, int *code, const int flags);
/* parsing/printing routines */
-static int str2strval( const char *str, struct berval **val,
+static int str2strval( const char *str, struct berval *val,
const char **next, unsigned flags, unsigned *retFlags );
-static int DCE2strval( const char *str, struct berval **val,
+static int DCE2strval( const char *str, struct berval *val,
const char **next, unsigned flags );
-static int IA52strval( const char *str, struct berval **val,
+static int IA52strval( const char *str, struct berval *val,
const char **next, unsigned flags );
-static int quotedIA52strval( const char *str, struct berval **val,
+static int quotedIA52strval( const char *str, struct berval *val,
const char **next, unsigned flags );
-static int hexstr2binval( const char *str, struct berval **val,
+static int hexstr2binval( const char *str, struct berval *val,
const char **next, unsigned flags );
static int hexstr2bin( const char *str, char *c );
static int byte2hexpair( const char *val, char *pair );
LDAPAVA *ava = tmpRDN[ iAVA ][ 0 ];
if ( ava->la_flags == LDAP_AVA_BINARY ) {
- vl = 1 + 2 * ava->la_value->bv_len;
+ vl = 1 + 2 * ava->la_value.bv_len;
} else {
- if ( strval2strlen( ava->la_value,
+ if ( strval2strlen( &ava->la_value,
ava->la_flags, &vl ) ) {
goto error_return;
}
}
if ( !notypes ) {
- al = ava->la_attr->bv_len;
- l = vl + ava->la_attr->bv_len + 1;
+ al = ava->la_attr.bv_len;
+ l = vl + ava->la_attr.bv_len + 1;
str = LDAP_MALLOC( l + 1 );
- AC_MEMCPY( str, ava->la_attr->bv_val,
- ava->la_attr->bv_len );
+ AC_MEMCPY( str, ava->la_attr.bv_val,
+ ava->la_attr.bv_len );
str[ al++ ] = '=';
} else {
if ( ava->la_flags == LDAP_AVA_BINARY ) {
str[ al++ ] = '#';
- if ( binval2hexstr( ava->la_value, &str[ al ] ) ) {
+ if ( binval2hexstr( &ava->la_value, &str[ al ] ) ) {
goto error_return;
}
} else {
- if ( strval2str( ava->la_value, &str[ al ],
+ if ( strval2str( &ava->la_value, &str[ al ],
ava->la_flags, &vl ) ) {
goto error_return;
}
#define LDAP_DN_IS_RDN_DC( r ) \
( (r) && (r)[0][0] && !(r)[1] \
&& ((r)[0][0]->la_flags == LDAP_AVA_STRING) \
- && ((r)[0][0]->la_attr->bv_len == 2) \
- && (((r)[0][0]->la_attr->bv_val[0] == LDAP_DC_ATTR[0]) \
- || ((r)[0][0]->la_attr->bv_val[0] == LDAP_DC_ATTRU[0])) \
- && (((r)[0][0]->la_attr->bv_val[1] == LDAP_DC_ATTR[1]) \
- || ((r)[0][0]->la_attr->bv_val[1] == LDAP_DC_ATTRU[1])))
+ && ((r)[0][0]->la_attr.bv_len == 2) \
+ && (((r)[0][0]->la_attr.bv_val[0] == LDAP_DC_ATTR[0]) \
+ || ((r)[0][0]->la_attr.bv_val[0] == LDAP_DC_ATTRU[0])) \
+ && (((r)[0][0]->la_attr.bv_val[1] == LDAP_DC_ATTR[1]) \
+ || ((r)[0][0]->la_attr.bv_val[1] == LDAP_DC_ATTRU[1])))
/* Composite rules */
#define LDAP_DN_ALLOW_ONE_SPACE(f) \
return( NULL );
}
- ava->la_attr = ( struct berval * )attr;
- ava->la_value = ( struct berval * )val;
+ ava->la_attr = *attr;
+ ava->la_value = *val;
ava->la_flags = flags;
ava->la_private = NULL;
assert( ava->la_private == NULL );
#endif
- ber_bvfree( ava->la_attr );
- ber_bvfree( ava->la_value );
+ free( ava->la_attr.bv_val );
+ free( ava->la_value.bv_val );
LDAP_FREE( ava );
}
int attrTypeEncoding = LDAP_AVA_STRING,
attrValueEncoding = LDAP_AVA_STRING;
- struct berval *attrType = NULL;
- struct berval *attrValue = NULL;
+ struct berval attrType = { 0, NULL };
+ struct berval attrValue = { 0, NULL };
LDAPRDN *newRDN = NULL;
LDAP_FREE( type );
} else {
- attrType = ber_bvstr( type );
- if ( attrType == NULL ) {
- rc = LDAP_NO_MEMORY;
- goto parsing_error;
- }
+ ber_str2bv( type, 0, 0, &attrType );
}
attrTypeEncoding = LDAP_AVA_BINARY;
break;
}
- assert( attrType == NULL );
- attrType = LDAP_MALLOC( sizeof( struct berval ) );
- if ( attrType == NULL ) {
+ attrType.bv_val = LDAP_STRNDUP( startPos, len );
+ if ( attrType.bv_val == NULL ) {
rc = LDAP_NO_MEMORY;
goto parsing_error;
}
- attrType->bv_val = LDAP_STRNDUP( startPos, len );
- if ( attrType->bv_val == NULL ) {
- rc = LDAP_NO_MEMORY;
- goto parsing_error;
- }
- attrType->bv_len = len;
+ attrType.bv_len = len;
break;
}
/*
* we accept empty values
*/
- ava = ldapava_new( attrType, attrValue,
+ ava = ldapava_new( &attrType, &attrValue,
attrValueEncoding );
if ( ava == NULL ) {
rc = LDAP_NO_MEMORY;
}
/* they should have been used in an AVA */
- attrType = NULL;
- attrValue = NULL;
+ attrType.bv_val = NULL;
+ attrValue.bv_val = NULL;
p++;
state = B4AVA;
parsing_error:;
/* They are set to NULL after they're used in an AVA */
- if ( attrType ) {
- ber_bvfree( attrType );
+ if ( attrType.bv_val ) {
+ free( attrType.bv_val );
}
- if ( attrValue ) {
- ber_bvfree( attrValue );
+ if ( attrValue.bv_val ) {
+ free( attrValue.bv_val );
}
if ( newRDN ) {
* '\' + HEXPAIR(p) -> unhex(p)
*/
static int
-str2strval( const char *str, struct berval **val, const char **next, unsigned flags, unsigned *retFlags )
+str2strval( const char *str, struct berval *val, const char **next, unsigned flags, unsigned *retFlags )
{
const char *p, *startPos, *endPos = NULL;
ber_len_t len, escapes, unescapes;
assert( val );
assert( next );
- *val = NULL;
*next = NULL;
for ( startPos = p = str, escapes = 0, unescapes = 0; p[ 0 ]; p++ ) {
* FIXME: test memory?
*/
len = ( endPos ? endPos : p ) - startPos - escapes - unescapes;
- *val = LDAP_MALLOC( sizeof( struct berval ) );
- ( *val )->bv_len = len;
+ val->bv_len = len;
if ( escapes == 0 && unescapes == 0 ) {
- ( *val )->bv_val = LDAP_STRNDUP( startPos, len );
+ val->bv_val = LDAP_STRNDUP( startPos, len );
} else {
ber_len_t s, d;
- ( *val )->bv_val = LDAP_MALLOC( len + 1 );
+ val->bv_val = LDAP_MALLOC( len + 1 );
for ( s = 0, d = 0; d < len; ) {
if ( LDAP_DN_ESCAPE( startPos[ s ] ) ) {
s++;
if ( ( s == 0 && LDAP_DN_NEEDESCAPE_LEAD( startPos[ s ] ) )
|| ( s == len - 1 && LDAP_DN_NEEDESCAPE_TRAIL( startPos[ s ] ) )
|| LDAP_DN_NEEDESCAPE( startPos[ s ] ) ) {
- ( *val )->bv_val[ d++ ] =
+ val->bv_val[ d++ ] =
startPos[ s++ ];
} else if ( LDAP_DN_HEXPAIR( &startPos[ s ] ) ) {
char c;
hexstr2bin( &startPos[ s ], &c );
- ( *val )->bv_val[ d++ ] = c;
+ val->bv_val[ d++ ] = c;
s += 2;
} else {
* we allow escaping of chars
* that do not need to
*/
- ( *val )->bv_val[ d++ ] =
+ val->bv_val[ d++ ] =
startPos[ s++ ];
}
} else {
- ( *val )->bv_val[ d++ ] = startPos[ s++ ];
+ val->bv_val[ d++ ] = startPos[ s++ ];
}
}
- ( *val )->bv_val[ d ] = '\0';
- assert( strlen( ( *val )->bv_val ) == len );
+ val->bv_val[ d ] = '\0';
+ assert( strlen( val->bv_val ) == len );
}
return( 0 );
}
static int
-DCE2strval( const char *str, struct berval **val, const char **next, unsigned flags )
+DCE2strval( const char *str, struct berval *val, const char **next, unsigned flags )
{
const char *p, *startPos, *endPos = NULL;
ber_len_t len, escapes;
assert( val );
assert( next );
- *val = NULL;
*next = NULL;
for ( startPos = p = str, escapes = 0; p[ 0 ]; p++ ) {
}
len = ( endPos ? endPos : p ) - startPos - escapes;
- *val = LDAP_MALLOC( sizeof( struct berval ) );
- ( *val )->bv_len = len;
+ val->bv_len = len;
if ( escapes == 0 ){
- ( *val )->bv_val = LDAP_STRNDUP( startPos, len );
+ val->bv_val = LDAP_STRNDUP( startPos, len );
} else {
ber_len_t s, d;
- ( *val )->bv_val = LDAP_MALLOC( len + 1 );
+ val->bv_val = LDAP_MALLOC( len + 1 );
for ( s = 0, d = 0; d < len; ) {
/*
* This point is reached only if escapes
s++;
}
- ( *val )->bv_val[ d++ ] = startPos[ s++ ];
+ val->bv_val[ d++ ] = startPos[ s++ ];
}
- ( *val )->bv_val[ d ] = '\0';
- assert( strlen( ( *val )->bv_val ) == len );
+ val->bv_val[ d ] = '\0';
+ assert( strlen( val->bv_val ) == len );
}
return( 0 );
}
static int
-IA52strval( const char *str, struct berval **val, const char **next, unsigned flags )
+IA52strval( const char *str, struct berval *val, const char **next, unsigned flags )
{
const char *p, *startPos, *endPos = NULL;
ber_len_t len, escapes;
assert( val );
assert( next );
- *val = NULL;
*next = NULL;
/*
return( 0 );
}
- *val = LDAP_MALLOC( sizeof( struct berval ) );
len = ( endPos ? endPos : p ) - startPos - escapes;
- ( *val )->bv_len = len;
+ val->bv_len = len;
if ( escapes == 0 ) {
- ( *val )->bv_val = LDAP_STRNDUP( startPos, len );
+ val->bv_val = LDAP_STRNDUP( startPos, len );
} else {
ber_len_t s, d;
- ( *val )->bv_val = LDAP_MALLOC( len + 1 );
+ val->bv_val = LDAP_MALLOC( len + 1 );
for ( s = 0, d = 0; d < len; ) {
if ( LDAP_DN_ESCAPE( startPos[ s ] ) ) {
s++;
}
- ( *val )->bv_val[ d++ ] = startPos[ s++ ];
+ val->bv_val[ d++ ] = startPos[ s++ ];
}
- ( *val )->bv_val[ d ] = '\0';
- assert( strlen( ( *val )->bv_val ) == len );
+ val->bv_val[ d ] = '\0';
+ assert( strlen( val->bv_val ) == len );
}
return( 0 );
}
static int
-quotedIA52strval( const char *str, struct berval **val, const char **next, unsigned flags )
+quotedIA52strval( const char *str, struct berval *val, const char **next, unsigned flags )
{
const char *p, *startPos, *endPos = NULL;
ber_len_t len;
assert( val );
assert( next );
- *val = NULL;
*next = NULL;
/* initial quote already eaten */
len = endPos - startPos - escapes;
assert( len >= 0 );
- *val = LDAP_MALLOC( sizeof( struct berval ) );
- ( *val )->bv_len = len;
+ val->bv_len = len;
if ( escapes == 0 ) {
- ( *val )->bv_val = LDAP_STRNDUP( startPos, len );
+ val->bv_val = LDAP_STRNDUP( startPos, len );
} else {
ber_len_t s, d;
- ( *val )->bv_val = LDAP_MALLOC( len + 1 );
- ( *val )->bv_len = len;
+ val->bv_val = LDAP_MALLOC( len + 1 );
+ val->bv_len = len;
for ( s = d = 0; d < len; ) {
if ( LDAP_DN_ESCAPE( str[ s ] ) ) {
s++;
}
- ( *val )->bv_val[ d++ ] = str[ s++ ];
+ val->bv_val[ d++ ] = str[ s++ ];
}
- ( *val )->bv_val[ d ] = '\0';
- assert( strlen( ( *val )->bv_val ) == len );
+ val->bv_val[ d ] = '\0';
+ assert( strlen( val->bv_val ) == len );
}
return( 0 );
}
static int
-hexstr2binval( const char *str, struct berval **val, const char **next, unsigned flags )
+hexstr2binval( const char *str, struct berval *val, const char **next, unsigned flags )
{
const char *p, *startPos, *endPos = NULL;
ber_len_t len;
assert( val );
assert( next );
- *val = NULL;
*next = NULL;
for ( startPos = p = str; p[ 0 ]; p += 2 ) {
/* must be even! */
assert( 2 * len == (ber_len_t) (( endPos ? endPos : p ) - startPos ));
- *val = LDAP_MALLOC( sizeof( struct berval ) );
- if ( *val == NULL ) {
- return( LDAP_NO_MEMORY );
- }
-
- ( *val )->bv_len = len;
- ( *val )->bv_val = LDAP_MALLOC( len + 1 );
- if ( ( *val )->bv_val == NULL ) {
- LDAP_FREE( *val );
+ val->bv_len = len;
+ val->bv_val = LDAP_MALLOC( len + 1 );
+ if ( val->bv_val == NULL ) {
return( LDAP_NO_MEMORY );
}
hexstr2bin( &startPos[ s ], &c );
- ( *val )->bv_val[ d ] = c;
+ val->bv_val[ d ] = c;
}
- ( *val )->bv_val[ d ] = '\0';
+ val->bv_val[ d ] = '\0';
return( 0 );
}
if ( first ) {
first = 0;
- AC_MEMCPY( str, ava->la_value->bv_val,
- ava->la_value->bv_len + 1);
- l += ava->la_value->bv_len;
+ AC_MEMCPY( str, ava->la_value.bv_val,
+ ava->la_value.bv_len + 1);
+ l += ava->la_value.bv_len;
} else {
- AC_MEMCPY( str + ava->la_value->bv_len + 1, bv->bv_val, l);
- AC_MEMCPY( str, ava->la_value->bv_val,
- ava->la_value->bv_len );
- str[ ava->la_value->bv_len ] = '.';
- l += ava->la_value->bv_len + 1;
+ AC_MEMCPY( str + ava->la_value.bv_len + 1, bv->bv_val, l);
+ AC_MEMCPY( str, ava->la_value.bv_val,
+ ava->la_value.bv_len );
+ str[ ava->la_value.bv_len ] = '.';
+ l += ava->la_value.bv_len + 1;
}
}
LDAPAVA *ava = rdn[ iAVA ][ 0 ];
/* len(type) + '=' + '+' | ',' */
- l += ava->la_attr->bv_len + 2;
+ l += ava->la_attr.bv_len + 2;
if ( ava->la_flags & LDAP_AVA_BINARY ) {
/* octothorpe + twice the length */
- l += 1 + 2 * ava->la_value->bv_len;
+ l += 1 + 2 * ava->la_value.bv_len;
} else {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( ( *s2l )( ava->la_value, f, &vl ) ) {
+ if ( ( *s2l )( &ava->la_value, f, &vl ) ) {
return( -1 );
}
l += vl;
for ( iAVA = 0; rdn[ iAVA ]; iAVA++ ) {
LDAPAVA *ava = rdn[ iAVA ][ 0 ];
- AC_MEMCPY( &str[ l ], ava->la_attr->bv_val,
- ava->la_attr->bv_len );
- l += ava->la_attr->bv_len;
+ AC_MEMCPY( &str[ l ], ava->la_attr.bv_val,
+ ava->la_attr.bv_len );
+ l += ava->la_attr.bv_len;
str[ l++ ] = '=';
if ( ava->la_flags & LDAP_AVA_BINARY ) {
str[ l++ ] = '#';
- if ( binval2hexstr( ava->la_value, &str[ l ] ) ) {
+ if ( binval2hexstr( &ava->la_value, &str[ l ] ) ) {
return( -1 );
}
- l += 2 * ava->la_value->bv_len;
+ l += 2 * ava->la_value.bv_len;
} else {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( ( *s2s )( ava->la_value, &str[ l ], f, &vl ) ) {
+ if ( ( *s2s )( &ava->la_value, &str[ l ], f, &vl ) ) {
return( -1 );
}
l += vl;
LDAPAVA *ava = rdn[ iAVA ][ 0 ];
/* len(type) + '=' + ',' | '/' */
- l += ava->la_attr->bv_len + 2;
+ l += ava->la_attr.bv_len + 2;
switch ( ava->la_flags ) {
case LDAP_AVA_BINARY:
/* octothorpe + twice the length */
- l += 1 + 2 * ava->la_value->bv_len;
+ l += 1 + 2 * ava->la_value.bv_len;
break;
case LDAP_AVA_STRING: {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( strval2DCEstrlen( ava->la_value, f, &vl ) ) {
+ if ( strval2DCEstrlen( &ava->la_value, f, &vl ) ) {
return( -1 );
}
l += vl;
str[ l++ ] = ( iAVA ? ',' : '/' );
}
- AC_MEMCPY( &str[ l ], ava->la_attr->bv_val,
- ava->la_attr->bv_len );
- l += ava->la_attr->bv_len;
+ AC_MEMCPY( &str[ l ], ava->la_attr.bv_val,
+ ava->la_attr.bv_len );
+ l += ava->la_attr.bv_len;
str[ l++ ] = '=';
switch ( ava->la_flags ) {
case LDAP_AVA_BINARY:
str[ l++ ] = '#';
- if ( binval2hexstr( ava->la_value, &str[ l ] ) ) {
+ if ( binval2hexstr( &ava->la_value, &str[ l ] ) ) {
return( -1 );
}
- l += 2 * ava->la_value->bv_len;
+ l += 2 * ava->la_value.bv_len;
break;
case LDAP_AVA_STRING: {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( strval2DCEstr( ava->la_value, &str[ l ], f, &vl ) ) {
+ if ( strval2DCEstr( &ava->la_value, &str[ l ], f, &vl ) ) {
return( -1 );
}
l += vl;
/* FIXME: are binary values allowed in UFN? */
if ( ava->la_flags & LDAP_AVA_BINARY ) {
/* octothorpe + twice the value */
- l += 1 + 2 * ava->la_value->bv_len;
+ l += 1 + 2 * ava->la_value.bv_len;
} else {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( strval2strlen( ava->la_value, f, &vl ) ) {
+ if ( strval2strlen( &ava->la_value, f, &vl ) ) {
return( -1 );
}
l += vl;
if ( ava->la_flags & LDAP_AVA_BINARY ) {
str[ l++ ] = '#';
- if ( binval2hexstr( ava->la_value, &str[ l ] ) ) {
+ if ( binval2hexstr( &ava->la_value, &str[ l ] ) ) {
return( -1 );
}
- l += 2 * ava->la_value->bv_len;
+ l += 2 * ava->la_value.bv_len;
} else {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( strval2str( ava->la_value, &str[ l ], f, &vl ) ) {
+ if ( strval2str( &ava->la_value, &str[ l ], f, &vl ) ) {
return( -1 );
}
l += vl;
switch ( ava->la_flags ) {
case LDAP_AVA_BINARY:
/* octothorpe + twice the value */
- l += 1 + 2 * ava->la_value->bv_len;
+ l += 1 + 2 * ava->la_value.bv_len;
break;
case LDAP_AVA_STRING: {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( strval2ADstrlen( ava->la_value, f, &vl ) ) {
+ if ( strval2ADstrlen( &ava->la_value, f, &vl ) ) {
return( -1 );
}
l += vl;
switch ( ava->la_flags ) {
case LDAP_AVA_BINARY:
str[ l++ ] = '#';
- if ( binval2hexstr( ava->la_value, &str[ l ] ) ) {
+ if ( binval2hexstr( &ava->la_value, &str[ l ] ) ) {
return( -1 );
}
- l += 2 * ava->la_value->bv_len;
+ l += 2 * ava->la_value.bv_len;
break;
case LDAP_AVA_STRING: {
ber_len_t vl;
unsigned f = flags | ava->la_flags;
- if ( strval2ADstr( ava->la_value, &str[ l ], f, &vl ) ) {
+ if ( strval2ADstr( &ava->la_value, &str[ l ], f, &vl ) ) {
return( -1 );
}
l += vl;
if ( ( ad = AVA_PRIVATE( ava ) ) == NULL ) {
const char *text = NULL;
- rc = slap_bv2ad( ava->la_attr, &ad, &text );
+ rc = slap_bv2ad( &ava->la_attr, &ad, &text );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
}
/*
* Replace attr oid/name with the canonical name
*/
- ber_bvfree( ava->la_attr );
- ava->la_attr = ber_bvdup( &ad->ad_cname );
+ free( ava->la_attr.bv_val );
+ ber_dupbv( &ava->la_attr, &ad->ad_cname );
validate = ad->ad_type->sat_syntax->ssyn_validate;
* validate value by validate function
*/
rc = ( *validate )( ad->ad_type->sat_syntax,
- ava->la_value );
+ &ava->la_value );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
assert( ava );
- a = strcmp( ava_in->la_attr->bv_val, ava->la_attr->bv_val );
+ a = strcmp( ava_in->la_attr.bv_val, ava->la_attr.bv_val );
if ( a > 0 ) {
break;
while ( a == 0 ) {
int v, d;
- d = ava_in->la_value->bv_len - ava->la_value->bv_len;
+ d = ava_in->la_value.bv_len - ava->la_value.bv_len;
- v = memcmp( ava_in->la_value->bv_val,
- ava->la_value->bv_val,
- d <= 0 ? ava_in->la_value->bv_len
- : ava->la_value->bv_len );
+ v = memcmp( ava_in->la_value.bv_val,
+ ava->la_value.bv_val,
+ d <= 0 ? ava_in->la_value.bv_len
+ : ava->la_value.bv_len );
if ( v == 0 && d != 0 ) {
v = d;
}
ava = rdn[ i ][ 0 ];
- a = strcmp( ava_in->la_value->bv_val,
- ava->la_value->bv_val );
+ a = strcmp( ava_in->la_value.bv_val,
+ ava->la_value.bv_val );
}
/*
if ( ( ad = AVA_PRIVATE( ava ) ) == NULL ) {
const char *text = NULL;
- rc = slap_bv2ad( ava->la_attr, &ad, &text );
+ rc = slap_bv2ad( &ava->la_attr, &ad, &text );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
}
/*
* Replace attr oid/name with the canonical name
*/
- ber_bvfree( ava->la_attr );
- ava->la_attr = ber_bvdup( &ad->ad_cname );
+ free( ava->la_attr.bv_val );
+ ber_dupbv( &ava->la_attr, &ad->ad_cname );
if( flags & SLAP_LDAPDN_PRETTY ) {
transf = ad->ad_type->sat_syntax->ssyn_pretty;
* transform value by normalize/pretty function
*/
rc = ( *transf )( ad->ad_type->sat_syntax,
- ava->la_value, &bv );
+ &ava->la_value, &bv );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
if( mr && ( mr->smr_usage & SLAP_MR_DN_FOLD ) ) {
struct berval *s = bv;
- bv = ber_bvstr( UTF8normalize( bv ? bv : ava->la_value,
+ bv = ber_bvstr( UTF8normalize( bv ? bv : &ava->la_value,
UTF8_CASEFOLD ) );
ber_bvfree( s );
}
if( bv ) {
- ber_bvfree( ava->la_value );
- ava->la_value = bv;
+ free( ava->la_value.bv_val );
+ ava->la_value = *bv;
+ free( bv );
}
AVA_Sort( rdn, iAVA );
LDAPAVA *ava = tmpRDN[ iAVA ][ 0 ];
assert( ava );
- assert( ava->la_attr );
- assert( ava->la_value );
+ assert( ava->la_attr.bv_val );
+ assert( ava->la_value.bv_val );
if ( types ) {
- charray_add_n( types, ava->la_attr->bv_val,
- ava->la_attr->bv_len );
+ charray_add_n( types, ava->la_attr.bv_val,
+ ava->la_attr.bv_len );
}
- charray_add_n( values, ava->la_value->bv_val,
- ava->la_value->bv_len );
+ charray_add_n( values, ava->la_value.bv_val,
+ ava->la_value.bv_len );
}
ldap_rdnfree( tmpRDN );