]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/dn.c
Additional fix for ITS#4522. The "dn=" ist not optional.
[openldap] / servers / slapd / dn.c
index 7effba1534808bad1945ca07ea6d61a21de3f780..be7b0aea0fa6d5c72cb7d1448a75125c0da4389c 100644 (file)
@@ -53,6 +53,8 @@
 
 #define        AVA_PRIVATE( ava ) ( ( AttributeDescription * )(ava)->la_private )
 
+int slap_DN_strict = SLAP_AD_NOINSERT;
+
 static int
 LDAPRDN_validate( LDAPRDN rdn )
 {
@@ -75,7 +77,7 @@ LDAPRDN_validate( LDAPRDN rdn )
                        if ( rc != LDAP_SUCCESS ) {
                                rc = slap_bv2undef_ad( &ava->la_attr,
                                        &ad, &text,
-                                       SLAP_AD_PROXIED|SLAP_AD_NOINSERT );
+                                       SLAP_AD_PROXIED|slap_DN_strict );
                                if ( rc != LDAP_SUCCESS ) {
                                        return LDAP_INVALID_SYNTAX;
                                }
@@ -139,7 +141,7 @@ LDAPDN_validate( LDAPDN dn )
                                if ( rc != LDAP_SUCCESS ) {
                                        rc = slap_bv2undef_ad( &ava->la_attr,
                                                &ad, &text,
-                                               SLAP_AD_PROXIED|SLAP_AD_NOINSERT );
+                                               SLAP_AD_PROXIED|slap_DN_strict );
                                        if ( rc != LDAP_SUCCESS ) {
                                                return LDAP_INVALID_SYNTAX;
                                        }
@@ -356,7 +358,7 @@ LDAPRDN_rewrite( LDAPRDN rdn, unsigned flags, void *ctx )
                        if ( rc != LDAP_SUCCESS ) {
                                rc = slap_bv2undef_ad( &ava->la_attr,
                                        &ad, &text,
-                                       SLAP_AD_PROXIED|SLAP_AD_NOINSERT );
+                                       SLAP_AD_PROXIED|slap_DN_strict );
                                if ( rc != LDAP_SUCCESS ) {
                                        return LDAP_INVALID_SYNTAX;
                                }
@@ -488,7 +490,7 @@ LDAPDN_rewrite( LDAPDN dn, unsigned flags, void *ctx )
                                if ( rc != LDAP_SUCCESS ) {
                                        rc = slap_bv2undef_ad( &ava->la_attr,
                                                &ad, &text,
-                                               SLAP_AD_PROXIED|SLAP_AD_NOINSERT );
+                                               SLAP_AD_PROXIED|slap_DN_strict );
                                        if ( rc != LDAP_SUCCESS ) {
                                                return LDAP_INVALID_SYNTAX;
                                        }
@@ -1304,7 +1306,7 @@ rdn_validate( struct berval *rdn )
 
 /* build_new_dn:
  *
- * Used by ldbm/bdb2 back_modrdn to create the new dn of entries being
+ * Used by back-bdb back_modrdn to create the new dn of entries being
  * renamed.
  *
  * new_dn = parent (p_dn) + separator + rdn (newrdn) + null.