[dovecot-cvs] dovecot/src/auth passdb-ldap.c,1.50,1.51
tss at dovecot.org
tss at dovecot.org
Sat Nov 4 21:08:46 UTC 2006
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv503
Modified Files:
passdb-ldap.c
Log Message:
Fixes to auth_bind.
Index: passdb-ldap.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-ldap.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- passdb-ldap.c 4 Nov 2006 20:22:31 -0000 1.50
+++ passdb-ldap.c 4 Nov 2006 21:08:42 -0000 1.51
@@ -251,23 +251,27 @@
struct auth_request *auth_request = ldap_request->context;
int msgid;
- /* switch back to the default dn before doing the next search request */
- conn->last_auth_bind = TRUE;
+ if (!conn->connecting) {
+ /* switch back to the default dn before doing the next search
+ request */
+ conn->last_auth_bind = TRUE;
- /* the DN is kept in base variable, a bit ugly.. */
- msgid = ldap_bind(conn->ld, ldap_request->base,
- auth_request->mech_password, LDAP_AUTH_SIMPLE);
- if (msgid == -1) {
- i_error("ldap_bind(%s) failed: %s",
- ldap_request->base, ldap_get_error(conn));
- passdb_ldap_request->callback.
- verify_plain(PASSDB_RESULT_INTERNAL_FAILURE,
- auth_request);
- return;
- }
+ /* the DN is kept in base variable, a bit ugly.. */
+ msgid = ldap_bind(conn->ld, ldap_request->base,
+ auth_request->mech_password,
+ LDAP_AUTH_SIMPLE);
+ if (msgid == -1) {
+ i_error("ldap_bind(%s) failed: %s",
+ ldap_request->base, ldap_get_error(conn));
+ passdb_ldap_request->callback.
+ verify_plain(PASSDB_RESULT_INTERNAL_FAILURE,
+ auth_request);
+ return;
+ }
- auth_request_log_debug(auth_request, "ldap", "bind: dn=%s",
- ldap_request->base);
+ auth_request_log_debug(auth_request, "ldap", "bind: dn=%s",
+ ldap_request->base);
+ }
/* Bind started */
auth_request_ref(auth_request);
More information about the dovecot-cvs
mailing list