From e3dec82d84391500ba9e9d9baa2a0c3f139979f8 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Tue, 27 May 2008 13:30:59 +0000 Subject: [PATCH] Merged revisions 118302 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r118302 | tilghman | 2008-05-27 08:30:10 -0500 (Tue, 27 May 2008) | 6 lines When binding anonymously, credentials are still needed. (closes issue #12601) Reported by: suretec Patches: res_config_ldap.c.patch uploaded by suretec (license 70) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@118303 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_config_ldap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c index b8816b920c..7ce37c65c8 100644 --- a/res/res_config_ldap.c +++ b/res/res_config_ldap.c @@ -1504,7 +1504,9 @@ static int ldap_reconnect(void) bind_result = ldap_sasl_bind_s(ldapConn, user, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); } else { ast_debug(2, "bind %s anonymously\n", url); - bind_result = ldap_sasl_bind_s(ldapConn, NULL, LDAP_SASL_SIMPLE, NULL, NULL, NULL, NULL); + cred.bv_val = NULL; + cred.bv_len = 0; + bind_result = ldap_sasl_bind_s(ldapConn, NULL, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); } if (bind_result == LDAP_SUCCESS) { ast_debug(2, "Successfully connected to database.\n");