]> git.sur5r.net Git - openldap/commitdiff
ITS#7850 catch invalid naming attr
authorHoward Chu <hyc@openldap.org>
Fri, 9 May 2014 18:29:45 +0000 (11:29 -0700)
committerHoward Chu <hyc@openldap.org>
Fri, 9 May 2014 18:29:45 +0000 (11:29 -0700)
servers/slapd/modrdn.c

index 04d5cb30ca911287036794b7f4dda7afc6fb3f6c..ed52fc02b00d2d980a9136eb9dd3af0216764cf1 100644 (file)
@@ -432,11 +432,22 @@ slap_modrdn2mods(
                        Debug( LDAP_DEBUG_TRACE,
                                "%s slap_modrdn2mods: %s: %s (new)\n",
                                op->o_log_prefix,
-                               rs->sr_text, 
+                               rs->sr_text,
                                new_rdn[ a_cnt ]->la_attr.bv_val );
                        goto done;              
                }
 
+               if ( !desc->ad_type->sat_equality ) {
+                       Debug( LDAP_DEBUG_TRACE,
+                               "%s slap_modrdn2mods: %s: %s (new)\n",
+                               op->o_log_prefix,
+                               rs->sr_text,
+                               new_rdn[ a_cnt ]->la_attr.bv_val );
+                       rs->sr_text = "naming attribute has no equality matching rule";
+                       rs->sr_err = LDAP_NAMING_VIOLATION;
+                       goto done;
+               }
+
                /* Apply modification */
                mod_tmp = ( Modifications * )ch_malloc( sizeof( Modifications ) );
                mod_tmp->sml_desc = desc;