diff options
| author | 2019-11-13 15:24:45 +0000 | |
|---|---|---|
| committer | 2019-11-13 15:24:45 +0000 | |
| commit | 7b689363218f1f7cd8d07c4ec3eaf03788b196c1 (patch) | |
| tree | 37bb397e948eac74cbd96a7e6ab637837622ffa0 /src/modules/m_dnsbl.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Improve the logic around connecting to a MySQL server. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_dnsbl.cpp')
| -rw-r--r-- | src/modules/m_dnsbl.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index b49fb09e3..eb384cedb 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -47,15 +47,21 @@ class DNSBLConfEntry : public refcountbase */ class DNSBLResolver : public DNS::Request { + private: + irc::sockets::sockaddrs theirsa; std::string theiruid; StringExtItem& nameExt; IntExtItem& countExt; reference<DNSBLConfEntry> ConfEntry; public: - DNSBLResolver(DNS::Manager *mgr, Module *me, StringExtItem& match, IntExtItem& ctr, const std::string &hostname, LocalUser* u, reference<DNSBLConfEntry> conf) - : DNS::Request(mgr, me, hostname, DNS::QUERY_A, true), theiruid(u->uuid), nameExt(match), countExt(ctr), ConfEntry(conf) + : DNS::Request(mgr, me, hostname, DNS::QUERY_A, true) + , theirsa(u->client_sa) + , theiruid(u->uuid) + , nameExt(match) + , countExt(ctr) + , ConfEntry(conf) { } @@ -63,8 +69,8 @@ class DNSBLResolver : public DNS::Request void OnLookupComplete(const DNS::Query *r) override { /* Check the user still exists */ - LocalUser* them = (LocalUser*)ServerInstance->FindUUID(theiruid); - if (!them) + LocalUser* them = IS_LOCAL(ServerInstance->FindUUID(theiruid)); + if (!them || them->client_sa != theirsa) return; const DNS::ResourceRecord* const ans_record = r->FindAnswerOfType(DNS::QUERY_A); @@ -209,8 +215,8 @@ class DNSBLResolver : public DNS::Request void OnError(const DNS::Query *q) override { - LocalUser* them = (LocalUser*)ServerInstance->FindUUID(theiruid); - if (!them) + LocalUser* them = IS_LOCAL(ServerInstance->FindUUID(theiruid)); + if (!them || them->client_sa != theirsa) return; int i = countExt.get(them); |
