]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/bind.c
uniformly exploit rootdn bind; add support for rootdn bind to backends that didn...
[openldap] / servers / slapd / back-sql / bind.c
index 7db1ac8e5dbf88dca9b463ec654bf6352c22209f..4c8f710c0bdf59ff76b679b7af389536137bf47b 100644 (file)
@@ -40,25 +40,18 @@ backsql_bind( Operation *op, SlapReply *rs )
  
        Debug( LDAP_DEBUG_TRACE, "==>backsql_bind()\n", 0, 0, 0 );
 
-       if ( be_isroot_pw( op ) ) {
-               ber_dupbv( &op->oq_bind.rb_edn, be_root_dn( op->o_bd ) );
-               Debug( LDAP_DEBUG_TRACE, "<==backsql_bind() root bind\n", 
-                               0, 0, 0 );
-               return LDAP_SUCCESS;
-       }
-
-       ber_dupbv( &op->oq_bind.rb_edn, &op->o_req_ndn );
-
-       if ( op->oq_bind.rb_method != LDAP_AUTH_SIMPLE ) {
-               rs->sr_err = LDAP_STRONG_AUTH_NOT_SUPPORTED;
-               rs->sr_text = "authentication method not supported"; 
-               send_ldap_result( op, rs );
+       switch ( be_rootdn_bind( op, rs ) ) {
+       case SLAP_CB_CONTINUE:
+               break;
+
+       default:
+               /* in case of success, front end will send result;
+                * otherwise, be_rootdn_bind() did */
+               Debug( LDAP_DEBUG_TRACE, "<==backsql_bind(%d)\n",
+                       rs->sr_err, 0, 0 );
                return rs->sr_err;
        }
 
-       /*
-        * method = LDAP_AUTH_SIMPLE
-        */
        rs->sr_err = backsql_get_db_conn( op, &dbh );
        if ( !dbh ) {
                Debug( LDAP_DEBUG_TRACE, "backsql_bind(): "