From 46bea91379b1ea04ee8d09ff425134cbc49886b2 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 15 Apr 2005 03:57:57 +0000 Subject: [PATCH] ITS#3657 added missing check --- servers/slapd/back-bdb/modrdn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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,