]> 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 f2e2dfb6d6c603ecfc049b72d76a675ebc7bb2ed..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 */
@@ -181,7 +180,7 @@ ldbm_back_modrdn(
 
                /* check parent for "children" acl */
                if ( ! access_allowed( be, conn, op, p,
-                       children, NULL, ACL_WRITE ) )
+                       children, NULL, ACL_WRITE, NULL ) )
                {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
@@ -228,7 +227,7 @@ ldbm_back_modrdn(
                                p = (Entry *)&slap_entry_root;
                                
                                rc = access_allowed( be, conn, op, p,
-                                               children, NULL, ACL_WRITE );
+                                               children, NULL, ACL_WRITE, NULL );
                                p = NULL;
                                                                
                                /* check parent for "children" acl */
@@ -342,7 +341,7 @@ ldbm_back_modrdn(
 
                        /* check newSuperior for "children" acl */
                        if ( !access_allowed( be, conn, op, np, children, NULL,
-                                             ACL_WRITE ) )
+                                             ACL_WRITE, NULL ) )
                        {
 #ifdef NEW_LOGGING
                                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
@@ -403,7 +402,7 @@ ldbm_back_modrdn(
                                        np = (Entry *)&slap_entry_root;
                                
                                        rc = access_allowed( be, conn, op, np,
-                                                       children, NULL, ACL_WRITE );
+                                                       children, NULL, ACL_WRITE, NULL );
                                        np = NULL;
                                                                
                                        /* check parent for "children" acl */
@@ -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
@@ -593,7 +589,7 @@ ldbm_back_modrdn(
                }
 
                if ( ! access_allowed( be, conn, op, e, 
-                               desc, &new_rdn[0][a_cnt]->la_value, ACL_WRITE ) ) {
+                               desc, &new_rdn[0][a_cnt]->la_value, ACL_WRITE, NULL ) ) {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
                                   "ldbm_back_modrdn: access "
@@ -666,7 +662,7 @@ ldbm_back_modrdn(
                        }
 
                        if ( ! access_allowed( be, conn, op, e, 
-                                       desc, &old_rdn[0][d_cnt]->la_value, ACL_WRITE ) ) {
+                                       desc, &old_rdn[0][d_cnt]->la_value, ACL_WRITE, NULL ) ) {
 #ifdef NEW_LOGGING
                                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
                                           "ldbm_back_modrdn: access "
@@ -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 ) {