From ff3eef491aa9e107d09d9dd9560ef7715b37b3b3 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 21 Oct 2009 23:45:32 +0000 Subject: Move all local-only fields to LocalUser git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11944 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ldapauth.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/modules/extra/m_ldapauth.cpp') diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp index 26e968367..af676de44 100644 --- a/src/modules/extra/m_ldapauth.cpp +++ b/src/modules/extra/m_ldapauth.cpp @@ -127,17 +127,16 @@ public: return MOD_RES_PASSTHRU; } - bool CheckCredentials(User* user) + bool CheckCredentials(LocalUser* user) { if (conn == NULL) if (!Connect()) return false; int res; - char* authpass = strdup(password.c_str()); // bind anonymously if no bind DN and authentication are given in the config struct berval cred; - cred.bv_val = authpass; + cred.bv_val = const_cast(password.c_str()); cred.bv_len = password.length(); if ((res = ldap_sasl_bind_s(conn, username.c_str(), LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL)) != LDAP_SUCCESS) @@ -155,13 +154,11 @@ public: { if (verbose) ServerInstance->SNO->WriteToSnoMask('c', "Forbidden connection from %s!%s@%s (LDAP bind failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), ldap_err2string(res)); - free(authpass); ldap_unbind_ext(conn, NULL, NULL); conn = NULL; return false; } } - free(authpass); LDAPMessage *msg, *entry; std::string what = (attribute + "=" + (useusername ? user->ident : user->nick)); -- cgit v1.3.1-10-gc9f91