]> git.sur5r.net Git - openldap/commitdiff
Fix order of statements in SLAPI internal modrdn implementation
authorLuke Howard <lukeh@openldap.org>
Wed, 20 Jul 2005 08:19:22 +0000 (08:19 +0000)
committerLuke Howard <lukeh@openldap.org>
Wed, 20 Jul 2005 08:19:22 +0000 (08:19 +0000)
servers/slapd/slapi/slapi_ops.c

index 73b2fbbad9d674b48dda98d3c3e3956c75e19e7d..c5f327150af1da5140e6f1c1be10dd8a740de303 100644 (file)
@@ -792,15 +792,6 @@ slapi_modrdn_internal_pb( Slapi_PBlock *pb )
                manageDsaIt = isCritical ? SLAP_CONTROL_CRITICAL : SLAP_CONTROL_NONCRITICAL; 
        }
 
-       op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 1 );
-       if ( op->o_bd == NULL ) {
-               rs.sr_err =  LDAP_PARTIAL_RESULTS;
-               goto cleanup;
-       }
-
-       op->o_dn = pConn->c_dn = op->o_bd->be_rootdn;
-       op->o_ndn = pConn->c_ndn = op->o_bd->be_rootndn;
-
        dn.bv_val = (char *)olddn;
        dn.bv_len = strlen( olddn );
 
@@ -814,6 +805,15 @@ slapi_modrdn_internal_pb( Slapi_PBlock *pb )
                goto cleanup;
        }
 
+       op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 1 );
+       if ( op->o_bd == NULL ) {
+               rs.sr_err =  LDAP_PARTIAL_RESULTS;
+               goto cleanup;
+       }
+
+       op->o_dn = pConn->c_dn = op->o_bd->be_rootdn;
+       op->o_ndn = pConn->c_ndn = op->o_bd->be_rootndn;
+
        newrdn.bv_val = (char *)lnewrdn;
        newrdn.bv_len = strlen( lnewrdn );