Commit 7bbc9032 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

fix up nvalues code so that pretty routines work properly

re-add objectClass pretty routines
parent 49a4ae59
......@@ -437,6 +437,7 @@ slap_mods2entry(
/* trim the mods array */
ch_free( mods->sml_nvalues );
mods->sml_nvalues = NULL;
} else {
attr->a_nvals = attr->a_vals;
}
......@@ -475,14 +476,20 @@ slap_mods2entry(
int rc = LDAP_SUCCESS;
int match;
for ( i = 0; mods->sml_nvalues[i].bv_val != NULL; i++ ) {
for ( i = 0; mods->sml_values[i].bv_val != NULL; i++ ) {
/* test asserted values against themselves */
for( j = 0; j < i; j++ ) {
rc = value_match( &match, mods->sml_desc, mr,
SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
| SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
| SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
&mods->sml_nvalues[i], &mods->sml_nvalues[j], text );
mods->sml_nvalues
? &mods->sml_nvalues[i]
: &mods->sml_values[i],
mods->sml_nvalues
? &mods->sml_nvalues[j]
: &mods->sml_values[j],
text );
if ( rc == LDAP_SUCCESS && match == 0 ) {
/* value exists already */
snprintf( textbuf, textlen,
......
......@@ -660,6 +660,8 @@ int slap_mods_check(
ml->sml_nvalues[nvals].bv_val = NULL;
ml->sml_nvalues[nvals].bv_len = 0;
} else {
}
}
}
......
......@@ -32,7 +32,6 @@
/* not yet implemented */
#define integerFirstComponentNormalize NULL
#define objectIdentifierNormalize NULL
#define objectIdentifierFirstComponentNormalize NULL
#define uniqueMemberMatch NULL
......@@ -1425,41 +1424,46 @@ telephoneNumberNormalize(
}
static int
oidValidate(
numericoidValidate(
Syntax *syntax,
struct berval *val )
struct berval *in )
{
ber_len_t i;
struct berval val = *in;
if( val->bv_len == 0 ) {
if( val.bv_len == 0 ) {
/* disallow empty strings */
return LDAP_INVALID_SYNTAX;
}
if( OID_LEADCHAR(val->bv_val[0]) ) {
int dot = 0;
for(i=1; i < val->bv_len; i++) {
if( OID_SEPARATOR( val->bv_val[i] ) ) {
if( dot++ ) return 1;
} else if ( OID_CHAR( val->bv_val[i] ) ) {
dot = 0;
} else {
return LDAP_INVALID_SYNTAX;
}
while( OID_LEADCHAR( val.bv_val[0] ) ) {
if ( val.bv_len == 1 ) {
return LDAP_SUCCESS;
}
return !dot ? LDAP_SUCCESS : LDAP_INVALID_SYNTAX;
if ( val.bv_val[0] == '0' ) {
break;
}
} else if( DESC_LEADCHAR(val->bv_val[0]) ) {
for(i=1; i < val->bv_len; i++) {
if( !DESC_CHAR(val->bv_val[i] ) ) {
return LDAP_INVALID_SYNTAX;
val.bv_val++;
val.bv_len--;
while ( OID_LEADCHAR( val.bv_val[0] )) {
val.bv_val++;
val.bv_len--;
if ( val.bv_len == 0 ) {
return LDAP_SUCCESS;
}
}
return LDAP_SUCCESS;
if( !OID_SEPARATOR( val.bv_val[0] )) {
break;
}
val.bv_val++;
val.bv_len--;
}
return LDAP_INVALID_SYNTAX;
}
......@@ -2689,7 +2693,7 @@ static slap_syntax_defs_rec syntax_defs[] = {
{"( 1.3.6.1.4.1.1466.115.121.1.37 DESC 'Object Class Description' )",
0, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.38 DESC 'OID' )",
0, oidValidate, NULL},
0, numericoidValidate, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.39 DESC 'Other Mailbox' )",
0, IA5StringValidate, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.40 DESC 'Octet String' )",
......@@ -2840,7 +2844,7 @@ static slap_mrule_defs_rec mrule_defs[] = {
{"( 2.5.13.0 NAME 'objectIdentifierMatch' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
SLAP_MR_EQUALITY | SLAP_MR_EXT, NULL,
NULL, objectIdentifierNormalize, octetStringMatch,
NULL, NULL, octetStringMatch,
octetStringIndexer, octetStringFilter,
NULL },
......
This diff is collapsed.
......@@ -205,7 +205,6 @@ value_match(
return LDAP_INAPPROPRIATE_MATCHING;
}
rc = (mr->smr_match)( match, flags,
ad->ad_type->sat_syntax,
mr,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment