ITS#2847: fix cn=#,...

This commit is contained in:
Kurt Zeilenga 2003-03-22 16:12:39 +00:00
parent 98e5afc28f
commit 61dffba479
2 changed files with 14 additions and 2 deletions

View File

@ -267,6 +267,11 @@ LDAPDN_rewrite( LDAPDN *dn, unsigned flags )
ava->la_attr = ad->ad_cname;
if( ava->la_flags & LDAP_AVA_BINARY ) {
if( ava->la_value.bv_len == 0 ) {
/* BER encoding is empty */
return LDAP_INVALID_SYNTAX;
}
/* AVA is binary encoded, don't muck with it */
} else if( flags & SLAP_LDAPDN_PRETTY ) {
transf = ad->ad_type->sat_syntax->ssyn_pretty;

View File

@ -845,10 +845,17 @@ entry_naming_check(
snprintf( textbuf, textlen,
"naming attribute '%s' is not present in entry",
ava->la_attr.bv_val );
rc = LDAP_NO_SUCH_ATTRIBUTE;
rc = LDAP_NAMING_VIOLATION;
break;
}
if( ava->la_flags & LDAP_AVA_BINARY ) {
snprintf( textbuf, textlen,
"value of naming attribute '%s' in unsupported BER form",
ava->la_attr.bv_val );
rc = LDAP_NAMING_VIOLATION;
}
#ifdef SLAP_NVALUES
if ( value_find_ex( desc,
SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
@ -861,7 +868,7 @@ entry_naming_check(
snprintf( textbuf, textlen,
"value of naming attribute '%s' is not present in entry",
ava->la_attr.bv_val );
rc = LDAP_NO_SUCH_ATTRIBUTE;
rc = LDAP_NAMING_VIOLATION;
break;
}
}