From: Howard Chu Date: Fri, 15 Apr 2005 03:57:57 +0000 (+0000) Subject: ITS#3657 added missing check X-Git-Tag: OPENLDAP_AC_BP~889 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=46bea91379b1ea04ee8d09ff425134cbc49886b2;p=openldap ITS#3657 added missing check --- diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 3bbf08d54b..e5a6024439 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -403,8 +403,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,