]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/bind.c
apparently Oracle does not support AS in joins (ITS#2642)
[openldap] / servers / slapd / back-sql / bind.c
index b768d40dc7fe4ac494e6e68e814198a9924cfe25..ce84c0ef27abc8906ab43c8bef1944036666511e 100644 (file)
@@ -29,6 +29,7 @@ backsql_bind( Operation *op, SlapReply *rs )
        Entry                   *e, user_entry;
        Attribute               *a;
        backsql_srch_info       bsi;
+       AttributeName           anlist[2];
        int                     rc;
  
        Debug( LDAP_DEBUG_TRACE, "==>backsql_bind()\n", 0, 0, 0 );
@@ -52,7 +53,7 @@ backsql_bind( Operation *op, SlapReply *rs )
        /*
         * method = LDAP_AUTH_SIMPLE
         */
-       rs->sr_err = backsql_get_db_conn( op->o_bd, op->o_conn, &dbh );
+       rs->sr_err = backsql_get_db_conn( op, &dbh );
        if (!dbh) {
                Debug( LDAP_DEBUG_TRACE, "backsql_bind(): "
                        "could not get connection handle - exiting\n",
@@ -74,8 +75,11 @@ backsql_bind( Operation *op, SlapReply *rs )
                return 1;
        }
 
-       backsql_init_search( &bsi, bi, &op->o_req_ndn, LDAP_SCOPE_BASE, 
-                       -1, -1, -1, NULL, dbh, op->o_bd, op->o_conn, op, NULL );
+       anlist[0].an_name = password->ad_cname;
+       anlist[0].an_desc = password;
+       anlist[1].an_name.bv_val = NULL;
+       backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE, 
+                       -1, -1, -1, NULL, dbh, op, anlist );
        e = backsql_id2entry( &bsi, &user_entry, &user_id );
        if ( e == NULL ) {
                Debug( LDAP_DEBUG_TRACE, "backsql_bind(): "
@@ -98,7 +102,7 @@ backsql_bind( Operation *op, SlapReply *rs )
                return 1;
        }
 
-       if ( slap_passwd_check( op->o_conn, a, &op->oq_bind.rb_cred ) != 0 ) {
+       if ( slap_passwd_check( op->o_conn, a, &op->oq_bind.rb_cred, &rs->sr_text ) != 0 ) {
                rs->sr_err = LDAP_INVALID_CREDENTIALS;
                send_ldap_result( op, rs );
                return 1;