summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorAdam <adam@sigterm.info>2013-05-15 12:33:47 -0700
committerAdam <adam@sigterm.info>2013-05-15 12:33:47 -0700
commite586aaab7c4f7b03514c83451d73b73f55dc6998 (patch)
tree18f4370778cc79d2f21a4308dafbb29a77cfa213 /src/modules/extra
parent23e8bba13c55d33ce89d505780da36c9589e300a (diff)
parentaccccc212cd4f08a3c5532b1ae7a17e76bac8718 (diff)
Merge pull request #531 from SaberUK/master+snprintf-removal
Replace some C-isms with C++-isms.
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ldapoper.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/modules/extra/m_ldapoper.cpp b/src/modules/extra/m_ldapoper.cpp
index 856e42dc3..f10773ec9 100644
--- a/src/modules/extra/m_ldapoper.cpp
+++ b/src/modules/extra/m_ldapoper.cpp
@@ -35,21 +35,6 @@
/* $ModDesc: Adds the ability to authenticate opers via LDAP */
/* $LinkerFlags: -lldap */
-// Duplicated code, also found in cmd_oper and m_sqloper
-static bool OneOfMatches(const char* host, const char* ip, const std::string& hostlist)
-{
- std::stringstream hl(hostlist);
- std::string xhost;
- while (hl >> xhost)
- {
- if (InspIRCd::Match(host, xhost, ascii_case_insensitive_map) || InspIRCd::MatchCIDR(ip, xhost, ascii_case_insensitive_map))
- {
- return true;
- }
- }
- return false;
-}
-
struct RAIILDAPString
{
char *str;
@@ -97,7 +82,7 @@ class ModuleLDAPAuth : public Module
std::string acceptedhosts = tag->getString("host");
std::string hostname = user->ident + "@" + user->host;
- if (!OneOfMatches(hostname.c_str(), user->GetIPString().c_str(), acceptedhosts))
+ if (!InspIRCd::MatchMask(acceptedhosts, hostname, user->GetIPString()))
return false;
if (!LookupOper(opername, inputpass))