diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 10 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 18 | ||||
-rw-r--r-- | src/modules/m_dnsbl.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_testnet.cpp | 5 |
5 files changed, 25 insertions, 29 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index c2dc4c878..243c8e28e 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -572,13 +572,13 @@ class ModuleSSLGnuTLS : public Module { if (user->eh.GetIOHook() == this) { - if (sessions[user->GetFd()].sess) + if (sessions[user->eh.GetFd()].sess) { - ssl_cert* cert = sessions[user->GetFd()].cert; + ssl_cert* cert = sessions[user->eh.GetFd()].cert; SSLCertSubmission(user, this, ServerInstance->Modules->Find("m_sslinfo.so"), cert); - std::string cipher = gnutls_kx_get_name(gnutls_kx_get(sessions[user->GetFd()].sess)); - cipher.append("-").append(gnutls_cipher_get_name(gnutls_cipher_get(sessions[user->GetFd()].sess))).append("-"); - cipher.append(gnutls_mac_get_name(gnutls_mac_get(sessions[user->GetFd()].sess))); + std::string cipher = gnutls_kx_get_name(gnutls_kx_get(sessions[user->eh.GetFd()].sess)); + cipher.append("-").append(gnutls_cipher_get_name(gnutls_cipher_get(sessions[user->eh.GetFd()].sess))).append("-"); + cipher.append(gnutls_mac_get_name(gnutls_mac_get(sessions[user->eh.GetFd()].sess))); if (cert->fingerprint.empty()) user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick.c_str(), cipher.c_str()); else diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 018d7351e..7d46cf66a 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -240,13 +240,13 @@ class ModuleSSLOpenSSL : public Module { if (user->eh.GetIOHook() == this) { - if (sessions[user->GetFd()].sess) + if (sessions[user->eh.GetFd()].sess) { - SSLCertSubmission(user, this, ServerInstance->Modules->Find("m_sslinfo.so"), sessions[user->GetFd()].cert); + SSLCertSubmission(user, this, ServerInstance->Modules->Find("m_sslinfo.so"), sessions[user->eh.GetFd()].cert); - if (!sessions[user->GetFd()].cert->fingerprint.empty()) + if (!sessions[user->eh.GetFd()].cert->fingerprint.empty()) user->WriteServ("NOTICE %s :*** You are connected using SSL fingerprint %s", - user->nick.c_str(), sessions[user->GetFd()].cert->fingerprint.c_str()); + user->nick.c_str(), sessions[user->eh.GetFd()].cert->fingerprint.c_str()); } } } diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 27309e677..618eec9f5 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -102,17 +102,17 @@ class CommandWebirc : public Command class CGIResolver : public Resolver { std::string typ; - int theirfd; - LocalUser* them; + std::string theiruid; bool notify; public: - CGIResolver(Module* me, bool NotifyOpers, const std::string &source, bool forward, LocalUser* u, int userfd, const std::string &type, bool &cached) - : Resolver(source, forward ? DNS_QUERY_A : DNS_QUERY_PTR4, cached, me), typ(type), theirfd(userfd), them(u), notify(NotifyOpers) { } + CGIResolver(Module* me, bool NotifyOpers, const std::string &source, bool forward, LocalUser* u, const std::string &type, bool &cached) + : Resolver(source, forward ? DNS_QUERY_A : DNS_QUERY_PTR4, cached, me), typ(type), theiruid(u->uuid), notify(NotifyOpers) { } virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached) { /* Check the user still exists */ - if ((them) && (&them->eh == ServerInstance->SE->GetRef(theirfd))) + User* them = ServerInstance->FindUUID(theiruid); + if (them) { if (notify) ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick.c_str(), them->host.c_str(), result.c_str(), typ.c_str()); @@ -128,7 +128,9 @@ class CGIResolver : public Resolver virtual void OnError(ResolverError e, const std::string &errormessage) { - if ((them) && (&them->eh == ServerInstance->SE->GetRef(theirfd))) + User* them = ServerInstance->FindUUID(theiruid); + if (them) + if (them) { if (notify) ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick.c_str(), them->host.c_str(), typ.c_str()); @@ -298,7 +300,7 @@ public: { bool cached; - CGIResolver* r = new CGIResolver(this, NotifyOpers, user->password, false, user, user->GetFd(), "PASS", cached); + CGIResolver* r = new CGIResolver(this, NotifyOpers, user->password, false, user, "PASS", cached); ServerInstance->AddResolver(r, cached); } catch (...) @@ -349,7 +351,7 @@ public: { bool cached; - CGIResolver* r = new CGIResolver(this, NotifyOpers, newipstr, false, user, user->GetFd(), "IDENT", cached); + CGIResolver* r = new CGIResolver(this, NotifyOpers, newipstr, false, user, "IDENT", cached); ServerInstance->AddResolver(r, cached); } catch (...) diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 8fa627ab8..818450b79 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -45,17 +45,15 @@ class DNSBLConfEntry */ class DNSBLResolver : public Resolver { - int theirfd; - LocalUser* them; + std::string theiruid; DNSBLConfEntry *ConfEntry; public: - DNSBLResolver(Module *me, const std::string &hostname, LocalUser* u, int userfd, DNSBLConfEntry *conf, bool &cached) + DNSBLResolver(Module *me, const std::string &hostname, LocalUser* u, DNSBLConfEntry *conf, bool &cached) : Resolver(hostname, DNS_QUERY_A, cached, me) { - theirfd = userfd; - them = u; + theiruid = u->uuid; ConfEntry = conf; } @@ -63,7 +61,8 @@ class DNSBLResolver : public Resolver virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached) { /* Check the user still exists */ - if ((them) && (&them->eh == ServerInstance->SE->GetRef(theirfd))) + User* them = ServerInstance->FindUUID(theiruid); + if (them) { // Now we calculate the bitmask: 256*(256*(256*a+b)+c)+d if(result.length()) @@ -352,7 +351,7 @@ class ModuleDNSBL : public Module /* now we'd need to fire off lookups for `hostname'. */ bool cached; - DNSBLResolver *r = new DNSBLResolver(this, hostname, user, user->GetFd(), *i, cached); + DNSBLResolver *r = new DNSBLResolver(this, hostname, user, *i, cached); ServerInstance->AddResolver(r, cached); } diff --git a/src/modules/m_testnet.cpp b/src/modules/m_testnet.cpp index 43c06978b..cd57cb52b 100644 --- a/src/modules/m_testnet.cpp +++ b/src/modules/m_testnet.cpp @@ -194,11 +194,6 @@ class CommandTest : public Command { IS_LOCAL(user)->CommandFloodPenalty += atoi(parameters[1].c_str()); } - else if (parameters[0] == "shutdown" && IS_LOCAL(user)) - { - int i = parameters.size() > 1 ? atoi(parameters[1].c_str()) : 2; - ServerInstance->SE->Shutdown(IS_LOCAL(user)->GetFd(), i); - } else if (parameters[0] == "check") { checkall(creator); |