]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/bind.c
Tweak cache_lru_print
[openldap] / servers / slapd / back-bdb / bind.c
index 9ebdfe7a86c5a55147f494f589baccff8db7fb4b..58cc7ccf33b4406e15730bfaf626823645847d5f 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2004 The OpenLDAP Foundation.
+ * Copyright 2000-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -88,8 +88,7 @@ dn2entry_retry:
        e = ei->bei_e;
        if ( rs->sr_err == DB_NOTFOUND ) {
                if( e != NULL ) {
-                       bdb_cache_return_entry_r( bdb->bi_dbenv,
-                               &bdb->bi_cache, e, &lock );
+                       bdb_cache_return_entry_r( bdb, e, &lock );
                        e = NULL;
                }
 
@@ -104,7 +103,6 @@ dn2entry_retry:
        ber_dupbv( &op->oq_bind.rb_edn, &e->e_name );
 
        /* check for deleted */
-#ifdef BDB_SUBENTRIES
        if ( is_entry_subentry( e ) ) {
                /* entry is an subentry, don't allow bind */
                Debug( LDAP_DEBUG_TRACE, "entry is subentry\n", 0,
@@ -112,7 +110,6 @@ dn2entry_retry:
                rs->sr_err = LDAP_INVALID_CREDENTIALS;
                goto done;
        }
-#endif
 
        if ( is_entry_alias( e ) ) {
                /* entry is an alias, don't allow bind */
@@ -130,25 +127,20 @@ dn2entry_retry:
 
        switch ( op->oq_bind.rb_method ) {
        case LDAP_AUTH_SIMPLE:
-               rs->sr_err = access_allowed( op, e,
-                       password, NULL, ACL_AUTH, NULL );
-               if ( ! rs->sr_err ) {
-                       rs->sr_err = LDAP_INVALID_CREDENTIALS;
-                       goto done;
-               }
-
-               if ( (a = attr_find( e->e_attrs, password )) == NULL ) {
+               a = attr_find( e->e_attrs, password );
+               if ( a == NULL ) {
                        rs->sr_err = LDAP_INVALID_CREDENTIALS;
                        goto done;
                }
 
-               if ( slap_passwd_check( op->o_conn,
-                       a, &op->oq_bind.rb_cred, &rs->sr_text ) != 0 )
+               if ( slap_passwd_check( op, e, a, &op->oq_bind.rb_cred,
+                                       &rs->sr_text ) != 0 )
                {
+                       /* failure; stop front end from sending result */
                        rs->sr_err = LDAP_INVALID_CREDENTIALS;
                        goto done;
                }
-
+                       
                rs->sr_err = 0;
                break;
 
@@ -203,7 +195,7 @@ dn2entry_retry:
 done:
        /* free entry and reader lock */
        if( e != NULL ) {
-               bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, e, &lock );
+               bdb_cache_return_entry_r( bdb, e, &lock );
        }
 
        LOCK_ID_FREE(bdb->bi_dbenv, locker);