]> git.sur5r.net Git - openldap/commitdiff
allow "traditional" behavior (more for ITS#4962; please debate)
authorPierangelo Masarati <ando@openldap.org>
Fri, 17 Aug 2007 09:51:29 +0000 (09:51 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 17 Aug 2007 09:51:29 +0000 (09:51 +0000)
servers/slapd/back-bdb/bind.c

index 634d398b07ac0cd7cabdc5a5048decae68838712..dc0be82b3076f74121269013031d1c3202d8a2a6 100644 (file)
@@ -39,6 +39,7 @@ bdb_bind( Operation *op, SlapReply *rs )
                "==> " LDAP_XSTRING(bdb_bind) ": dn: %s\n",
                op->o_req_dn.bv_val, 0, 0);
 
+#ifdef LDAP_DEVEL
        /* allow noauth binds */
        switch ( be_rootdn_bind( op, rs ) ) {
        case SLAP_CB_CONTINUE:
@@ -50,6 +51,18 @@ bdb_bind( Operation *op, SlapReply *rs )
                return rs->sr_err;
        }
 
+#else /* traditional */
+       /* allow noauth binds */
+       switch ( be_rootdn_bind( op, NULL ) ) {
+       case LDAP_SUCCESS:
+               /* frontend will send result */
+               return rs->sr_err;
+
+       default:
+               /* give the database a chanche */
+               break;
+       }
+
        rs->sr_err = LOCK_ID(bdb->bi_dbenv, &locker);
        switch(rs->sr_err) {
        case 0:
@@ -59,6 +72,7 @@ bdb_bind( Operation *op, SlapReply *rs )
                send_ldap_result( op, rs );
                return rs->sr_err;
        }
+#endif /* traditional */
 
 dn2entry_retry:
        /* get entry with reader lock */