andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

Blame 0156-Ticket-47641-7-bit-check-plugin-not-checking-MODRDN-.patch

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