mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Fix -USLAP_NVALUES
This commit is contained in:
parent
25886d989a
commit
46a2616b83
@ -413,7 +413,7 @@ slap_mods2entry(
|
|||||||
for( i=0; attr->a_vals[i].bv_val; i++ ) {
|
for( i=0; attr->a_vals[i].bv_val; i++ ) {
|
||||||
/* count them */
|
/* count them */
|
||||||
}
|
}
|
||||||
for( j=0; mods->sml_nvalues[j].bv_val; j++ ) {
|
for( j=0; mods->sml_values[j].bv_val; j++ ) {
|
||||||
/* count them */
|
/* count them */
|
||||||
}
|
}
|
||||||
j++; /* NULL */
|
j++; /* NULL */
|
||||||
@ -423,13 +423,14 @@ slap_mods2entry(
|
|||||||
|
|
||||||
/* should check for duplicates */
|
/* should check for duplicates */
|
||||||
|
|
||||||
AC_MEMCPY( &attr->a_vals[i], mods->sml_nvalues,
|
AC_MEMCPY( &attr->a_vals[i], mods->sml_values,
|
||||||
sizeof( struct berval ) * j );
|
sizeof( struct berval ) * j );
|
||||||
|
|
||||||
/* trim the mods array */
|
/* trim the mods array */
|
||||||
ch_free( mods->sml_nvalues );
|
ch_free( mods->sml_values );
|
||||||
mods->sml_nvalues = NULL;
|
mods->sml_values = NULL;
|
||||||
|
|
||||||
|
#ifdef SLAP_NVALUES
|
||||||
if( attr->a_nvals ) {
|
if( attr->a_nvals ) {
|
||||||
attr->a_nvals = ch_realloc( attr->a_nvals,
|
attr->a_nvals = ch_realloc( attr->a_nvals,
|
||||||
sizeof( struct berval ) * (i+j) );
|
sizeof( struct berval ) * (i+j) );
|
||||||
@ -441,6 +442,7 @@ slap_mods2entry(
|
|||||||
ch_free( mods->sml_nvalues );
|
ch_free( mods->sml_nvalues );
|
||||||
mods->sml_nvalues = NULL;
|
mods->sml_nvalues = NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
#else
|
#else
|
||||||
|
@ -562,7 +562,7 @@ int slap_mods_check(
|
|||||||
/*
|
/*
|
||||||
* check values
|
* check values
|
||||||
*/
|
*/
|
||||||
if( ml->sml_nvalues != NULL ) {
|
if( ml->sml_values != NULL ) {
|
||||||
ber_len_t nvals;
|
ber_len_t nvals;
|
||||||
slap_syntax_validate_func *validate =
|
slap_syntax_validate_func *validate =
|
||||||
ad->ad_type->sat_syntax->ssyn_validate;
|
ad->ad_type->sat_syntax->ssyn_validate;
|
||||||
@ -583,14 +583,14 @@ int slap_mods_check(
|
|||||||
* check that each value is valid per syntax
|
* check that each value is valid per syntax
|
||||||
* and pretty if appropriate
|
* and pretty if appropriate
|
||||||
*/
|
*/
|
||||||
for( nvals = 0; ml->sml_nvalues[nvals].bv_val; nvals++ ) {
|
for( nvals = 0; ml->sml_values[nvals].bv_val; nvals++ ) {
|
||||||
struct berval pval;
|
struct berval pval;
|
||||||
if( pretty ) {
|
if( pretty ) {
|
||||||
rc = pretty( ad->ad_type->sat_syntax,
|
rc = pretty( ad->ad_type->sat_syntax,
|
||||||
&ml->sml_nvalues[nvals], &pval );
|
&ml->sml_values[nvals], &pval );
|
||||||
} else {
|
} else {
|
||||||
rc = validate( ad->ad_type->sat_syntax,
|
rc = validate( ad->ad_type->sat_syntax,
|
||||||
&ml->sml_nvalues[nvals] );
|
&ml->sml_values[nvals] );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( rc != 0 ) {
|
if( rc != 0 ) {
|
||||||
@ -602,8 +602,8 @@ int slap_mods_check(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( pretty ) {
|
if( pretty ) {
|
||||||
ber_memfree( ml->sml_nvalues[nvals].bv_val );
|
ber_memfree( ml->sml_values[nvals].bv_val );
|
||||||
ml->sml_nvalues[nvals] = pval;
|
ml->sml_values[nvals] = pval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user