summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-10 21:32:11 -0400
committerAdam <Adam@anope.org>2012-10-10 21:32:11 -0400
commitcad8e26a8f9a61f6d8a6dfa5127da98101181075 (patch)
treed0ab2100ffbd9709501558c20da2995d3145a348 /src
parentc8707149b2a9a1b9774457c2d1629d37920b9f74 (diff)
Compare the result of ldap_search_ext_s to LDAP_SUCCESS....
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_ldapauth.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp
index 1b6a3a0d9..5d71e7389 100644
--- a/src/modules/extra/m_ldapauth.cpp
+++ b/src/modules/extra/m_ldapauth.cpp
@@ -211,7 +211,7 @@ public:
std::string cutpassword = user->password.substr(0, pos);
res = ldap_search_ext_s(conn, base.c_str(), searchscope, cutpassword.c_str(), NULL, 0, NULL, NULL, NULL, 0, &msg);
- if (res)
+ if (res == LDAP_SUCCESS)
{
// Trim the user: prefix, leaving just 'pass' for later password check
user->password = user->password.substr(pos + 1);
@@ -219,7 +219,7 @@ public:
}
// It may have found based on user:pass check above.
- if (!res)
+ if (res != LDAP_SUCCESS)
{
if (verbose)
ServerInstance->SNO->WriteToSnoMask('c', "Forbidden connection from %s!%s@%s (LDAP search failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), ldap_err2string(res));