diff options
-rw-r--r-- | src/modules/extra/m_ldapauth.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp index ab56de6d7..211880f05 100644 --- a/src/modules/extra/m_ldapauth.cpp +++ b/src/modules/extra/m_ldapauth.cpp @@ -173,6 +173,13 @@ public: ldap_msgfree(msg); return false; } + if (user->password.empty()) + { + if (verbose) + ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (No password provided)", user->nick.c_str(), user->ident.c_str(), user->host.c_str()); + user->Extend("ldapauth_failed"); + return false; + } cred.bv_val = (char*)user->password.data(); cred.bv_len = user->password.length(); if ((res = ldap_sasl_bind_s(conn, ldap_get_dn(conn, entry), LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL)) == LDAP_SUCCESS) |