From: Howard Chu Date: Fri, 9 May 2014 18:29:45 +0000 (-0700) Subject: ITS#7850 catch invalid naming attr X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=141f16809381c0ba58ff8af0008370360c6c2004;p=openldap ITS#7850 catch invalid naming attr --- diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 04d5cb30ca..ed52fc02b0 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -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;