]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/id2entry.c
Sync with HEAD for OL 2.4.5
[openldap] / servers / slapd / back-bdb / id2entry.c
index 8ef594023c4ccb550e4f6f5285a2411d1cad7252..98c75bb9fa952e6b69ca561d72b4b2edf30c8c9f 100644 (file)
@@ -93,7 +93,7 @@ int bdb_id2entry_update(
 int bdb_id2entry(
        BackendDB *be,
        DB_TXN *tid,
-       u_int32_t locker,
+       BDB_LOCKER locker,
        ID id,
        Entry **e )
 {
@@ -121,26 +121,27 @@ int bdb_id2entry(
        if ( rc ) return rc;
 
        /* Use our own locker if needed */
-       if ( !tid && locker )
-               cursor->locker = locker;
+       if ( !tid && locker ) {
+               CURSOR_SETLOCKER( cursor, locker );
+       }
 
        /* Get the nattrs / nvals counts first */
        data.ulen = data.dlen = sizeof(buf);
        data.data = buf;
        rc = cursor->c_get( cursor, &key, &data, DB_SET );
-       if ( rc ) goto leave;
+       if ( rc ) goto finish;
 
 
        eh.bv.bv_val = buf;
        eh.bv.bv_len = data.size;
        rc = entry_header( &eh );
-       if ( rc ) goto leave;
+       if ( rc ) goto finish;
 
        /* Get the size */
        data.flags ^= DB_DBT_PARTIAL;
        data.ulen = 0;
        rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
-       if ( rc != DB_BUFFER_SMALL ) goto leave;
+       if ( rc != DB_BUFFER_SMALL ) goto finish;
 
        /* Allocate a block and retrieve the data */
        off = eh.data - eh.bv.bv_val;
@@ -155,7 +156,7 @@ int bdb_id2entry(
 
        rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
 
-leave:
+finish:
        cursor->c_close( cursor );
 
        if( rc != 0 ) {
@@ -317,7 +318,7 @@ int bdb_entry_get(
        int     rc;
        const char *at_name = at ? at->ad_cname.bv_val : "(null)";
 
-       u_int32_t       locker = 0;
+       BDB_LOCKER      locker = 0;
        DB_LOCK         lock;
        int             free_lock_id = 0;
 
@@ -384,21 +385,6 @@ dn2entry_retry:
                "=> bdb_entry_get: found entry: \"%s\"\n",
                ndn->bv_val, 0, 0 ); 
 
-       /* find attribute values */
-       if( is_entry_alias( e ) ) {
-               Debug( LDAP_DEBUG_ACL,
-                       "<= bdb_entry_get: entry is an alias\n", 0, 0, 0 );
-               rc = LDAP_ALIAS_PROBLEM;
-               goto return_results;
-       }
-
-       if( is_entry_referral( e ) ) {
-               Debug( LDAP_DEBUG_ACL,
-                       "<= bdb_entry_get: entry is a referral\n", 0, 0, 0 );
-               rc = LDAP_REFERRAL;
-               goto return_results;
-       }
-
        if ( oc && !is_entry_objectclass( e, oc, 0 )) {
                Debug( LDAP_DEBUG_ACL,
                        "<= bdb_entry_get: failed to find objectClass %s\n",