summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:45:32 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:45:32 +0000
commitff3eef491aa9e107d09d9dd9560ef7715b37b3b3 (patch)
tree76532ed5d9dd8ec0deb86793bc72d548e7a4c76a /src/modules/extra
parent123eac3f25ce4dd3142b4ac66eb321f7df1e23e4 (diff)
Move all local-only fields to LocalUser
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11944 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ldapauth.cpp7
1 files changed, 2 insertions, 5 deletions
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<char*>(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));