]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modrdn.c
ITS#8460 fix slap_op_time
[openldap] / servers / slapd / modrdn.c
index 986664d5f6160ce6142cedf3b5985d760043b57e..cea3ba83285c0ec9a64635fb8ca2d04fd6df4619 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2013 The OpenLDAP Foundation.
+ * Copyright 1998-2016 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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;