]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/bind.c
Add ability to cache negative results and specify negative TTL on templates
[openldap] / servers / slapd / bind.c
index 6fb47737ef998b6a39b80dbfbbdec6d59c7c7918..8c261489e8657f7226c542a45dc2ff66458db421 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -207,8 +207,6 @@ cleanup:
                op->o_conn->c_authtype = op->orb_method;
        }
 
-       op->o_conn->c_sasl_bindop = NULL;
-
        if( !BER_BVISNULL( &op->o_req_dn ) ) {
                slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
                BER_BVZERO( &op->o_req_dn );
@@ -225,6 +223,7 @@ int
 fe_op_bind( Operation *op, SlapReply *rs )
 {
        struct berval   mech = op->orb_tmp_mech;
+       BackendDB       *bd = op->o_bd;
 
        /* check for inappropriate controls */
        if( get_manageDSAit( op ) == SLAP_CONTROL_CRITICAL ) {
@@ -389,9 +388,8 @@ fe_op_bind( Operation *op, SlapReply *rs )
                /* don't return referral for bind requests */
                /* noSuchObject is not allowed to be returned by bind */
                rs->sr_err = LDAP_INVALID_CREDENTIALS;
-               op->o_bd = frontendDB;
+               op->o_bd = bd;
                send_ldap_result( op, rs );
-               op->o_bd = NULL;
                goto cleanup;
        }
 
@@ -454,6 +452,7 @@ fe_op_bind( Operation *op, SlapReply *rs )
        }
 
 cleanup:;
+       op->o_bd = bd;
        return rs->sr_err;
 }