]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_init.c
liberally accept many LDAPv2/LDAPv3 stuff in DN (quoted parts, ';' as rdn separator...
[openldap] / servers / slapd / schema_init.c
index e6653a673ebee2fc5ca13eeeb94bf573ab56a545..8437777e12722ed44d77784a3079b37862fca325 100644 (file)
@@ -235,7 +235,11 @@ dnValidate(
                return( LDAP_SUCCESS );
        }
 
-       rc = ldap_str2dn( in->bv_val, &dn, LDAP_DN_FORMAT_LDAPV3 );
+       rc = ldap_str2dn( in->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
+
+       /*
+        * Fixme: should we also validate each DN component?
+        */
        ldapava_free_dn( dn );
        
        if ( rc != LDAP_SUCCESS ) {
@@ -400,7 +404,7 @@ dnNormalize(
                /*
                 * Go to structural representation
                 */
-               rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAPV3 );
+               rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
                if ( rc != LDAP_SUCCESS ) {
                        return LDAP_INVALID_SYNTAX;
                }
@@ -453,7 +457,7 @@ dnPretty(
                int             rc;
 
                /* FIXME: should be liberal in what we accept */
-               rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAPV3 );
+               rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
                if ( rc != LDAP_SUCCESS ) {
                        return LDAP_INVALID_SYNTAX;
                }
@@ -504,13 +508,7 @@ dnMatch(
        match = value->bv_len - asserted->bv_len;
 
        if ( match == 0 ) {
-#ifdef USE_DN_NORMALIZE
                match = strcmp( value->bv_val, asserted->bv_val );
-               fprintf(stderr, "USE_DN_NORMALIZE :(\n");
-#else
-               match = strcasecmp( value->bv_val, asserted->bv_val );
-               fprintf(stderr, "!USE_DN_NORMALIZE :)\n");
-#endif
        }
 
 #ifdef NEW_LOGGING
@@ -4596,7 +4594,7 @@ struct syntax_defs_rec syntax_defs[] = {
        {"( 1.3.6.1.4.1.1466.115.121.1.11 DESC 'Country String' )",
                0, countryStringValidate, IA5StringNormalize, NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'Distinguished Name' )",
-               0, dnValidate, dnNormalize, NULL},
+               0, dnValidate, dnNormalize, dnPretty},
        {"( 1.3.6.1.4.1.1466.115.121.1.13 DESC 'Data Quality' )",
                0, NULL, NULL, NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.14 DESC 'Delivery Method' )",