From 056482bc1773e9ed40d9ebe01f281f3be2ac069a Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Wed, 22 Jan 2014 11:08:18 -0500
Subject: [PATCH 156/225] Ticket 47641 - 7-bit check plugin not checking MODRDN
operation
Bug Description: 7-bit check is not being performed on modrdn operations.
Fix Description: The "superior" DN was not properly being checked/set, and
caused the 7-bit check to be skipped.
https://fedorahosted.org/389/ticket/47641
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit ddbec8c4cea448b775e3848c328cb86b238fe35f)
(cherry picked from commit 7a5f2e7b4d9cecd5dd63e3ac72107b14631f49da)
---
ldap/servers/plugins/uiduniq/7bit.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ldap/servers/plugins/uiduniq/7bit.c b/ldap/servers/plugins/uiduniq/7bit.c
index fbcc530..0459bb5 100644
--- a/ldap/servers/plugins/uiduniq/7bit.c
+++ b/ldap/servers/plugins/uiduniq/7bit.c
@@ -544,7 +544,7 @@ preop_modrdn(Slapi_PBlock *pb)
char **argv;
char **attrName;
Slapi_DN *target_sdn = NULL;
- Slapi_DN *superior;
+ Slapi_DN *superior = NULL;
char *rdn;
Slapi_Attr *attr;
char **firstSubtree;
@@ -584,7 +584,7 @@ preop_modrdn(Slapi_PBlock *pb)
* its current level in the tree. Use the target DN for
* determining which managed tree this belongs to
*/
- if (!superior) superior = target_sdn;
+ if (!slapi_sdn_get_dn(superior)) superior = target_sdn;
/* Get the new RDN - this has the attribute values */
err = slapi_pblock_get(pb, SLAPI_MODRDN_NEWRDN, &rdn);
@@ -618,7 +618,7 @@ preop_modrdn(Slapi_PBlock *pb)
}
/*
- * arguments before "," are the 7-bit clean attribute names. Arguemnts
+ * arguments before "," are the 7-bit clean attribute names. Arguments
* after "," are subtreeDN's.
*/
for ( firstSubtree = argv; strcmp(*firstSubtree, ",") != 0;
@@ -633,7 +633,7 @@ preop_modrdn(Slapi_PBlock *pb)
for (attrName = argv; strcmp(*attrName, ",") != 0; attrName++ )
{
/*
- * If the attribut type is userpassword, do not replace it by
+ * If the attribute type is userpassword, do not replace it by
* unhashed#user#password because unhashed#user#password does not exist
* in this case.
*/
--
1.8.1.4