-/*
- * Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License. A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
+ * Copyright 1999-2004 The OpenLDAP Foundation.
+ * Portions Copyright 1999 Dmitry Kovalev.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Dmitry Kovalev for inclusion
+ * by OpenLDAP Software.
*/
#include "portable.h"
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 );
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(): "
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;