]> git.sur5r.net Git - openldap/commitdiff
ITS#2847: fix cn=#,...
authorKurt Zeilenga <kurt@openldap.org>
Sat, 22 Mar 2003 16:12:39 +0000 (16:12 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 22 Mar 2003 16:12:39 +0000 (16:12 +0000)
servers/slapd/dn.c
servers/slapd/schema_check.c

index 647468d92bffc5ba5804596c44278e2870f6b271..b1168901c001dac8fadb72f57778ef1e983be181 100644 (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;
index 75cf612d2f72a259826edf3df0c0cbdb3423badc..357f7f5ae96dfff2dabcb0fcc28d05b445b61422 100644 (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;
                }
        }