]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Import ITS#3657 check
authorHoward Chu <hyc@openldap.org>
Thu, 21 Apr 2005 03:41:32 +0000 (03:41 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 21 Apr 2005 03:41:32 +0000 (03:41 +0000)
servers/slapd/back-bdb/modrdn.c

index f25ceca2dcc4766f536820dded09f7d7b5ab9a47..57fd983f2fe7fa991fe5f9fb633eb108e5dcd60b 100644 (file)
@@ -426,8 +426,13 @@ retry:     /* transaction retry */
                        np_dn = op->oq_modrdn.rs_newSup;
                        np_ndn = op->oq_modrdn.rs_nnewSup;
 
-                       /* newSuperior == oldParent?, if so ==> ERROR */
+                       /* newSuperior == oldParent? - checked above */
                        /* newSuperior == entry being moved?, if so ==> ERROR */
+                       if ( dnIsSuffix( np_ndn, &e->e_nname )) {
+                               rs->sr_err = LDAP_NAMING_VIOLATION;
+                               rs->sr_text = "new superior is invalid";
+                               goto return_results;
+                       }
                        /* Get Entry with dn=newSuperior. Does newSuperior exist? */
 
                        rs->sr_err = bdb_dn2entry( op, ltid, np_ndn,