]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/modrdn.c
Set peeraddr also for IPv6, fixes ITS#1918
[openldap] / servers / slapd / back-ldbm / modrdn.c
index 2329b53f2d752674f6b6536670403ce2119b9917..59aee6894c5d6a2318369dc978ef29c46b4a4701 100644 (file)
@@ -53,7 +53,6 @@ ldbm_back_modrdn(
        Entry           *e, *p = NULL;
        Entry           *matched;
        int             isroot = -1;
-       int             rootlock = 0;
 #define CAN_ROLLBACK   -1
 #define MUST_DESTROY   1
        int             rc = CAN_ROLLBACK;
@@ -63,8 +62,8 @@ ldbm_back_modrdn(
        char textbuf[SLAP_TEXT_BUFLEN];
        size_t textlen = sizeof textbuf;
        /* Added to support LDAP v2 correctly (deleteoldrdn thing) */
-       LDAPRDN         *new_rdn;
-       LDAPRDN         *old_rdn;
+       LDAPRDN         *new_rdn = NULL;
+       LDAPRDN         *old_rdn = NULL;
        int             a_cnt, d_cnt;
        /* Added to support newSuperior */ 
        Entry           *np = NULL;     /* newSuperior Entry */
@@ -469,13 +468,10 @@ ldbm_back_modrdn(
 #endif
 
        /* check for abandon */
-       ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
        if ( op->o_abandon ) {
-               ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
                goto return_results;
        }
 
-       ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
        if ( ( rc_id = dn2id ( be, &new_ndn, &id ) ) || id != NOID ) {
                /* if (rc_id) something bad happened to ldbm cache */
                send_ldap_result( conn, op, 
@@ -497,7 +493,7 @@ ldbm_back_modrdn(
        /* Get attribute types and values of our new rdn, we will
         * need to add that to our new entry
         */
-       if ( ldap_str2rdn( newrdn->bv_val, &new_rdn, (char **)&text,
+       if ( ldap_bv2rdn( newrdn, &new_rdn, (char **)&text,
                LDAP_DN_FORMAT_LDAP ) )
        {
 #ifdef NEW_LOGGING
@@ -525,7 +521,7 @@ ldbm_back_modrdn(
 #endif
 
        /* Retrieve the old rdn from the entry's dn */
-       if ( ldap_str2rdn( dn->bv_val, &old_rdn, (char **)&text,
+       if ( ldap_bv2rdn( dn, &old_rdn, (char **)&text,
                LDAP_DN_FORMAT_LDAP ) )
        {
 #ifdef NEW_LOGGING
@@ -709,12 +705,9 @@ ldbm_back_modrdn(
 
        
        /* check for abandon */
-       ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
        if ( op->o_abandon ) {
-               ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
                goto return_results;
        }
-       ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
 
        /* delete old one */
        if ( dn2id_delete( be, &e->e_nname, e->e_id ) != 0 ) {