mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Fix cloaking users with a non-IP hostname when using hmac-sha256-ip.
This commit is contained in:
parent
7dbc0f8208
commit
9109587ed2
@ -136,6 +136,10 @@ public:
|
||||
const std::string cloak = cloakmethod->Generate(user);
|
||||
if (!cloak.empty())
|
||||
cloaks->push_back(cloak);
|
||||
|
||||
ServerInstance->Logs.Debug(MODNAME, "Cloaked %s (%s/%s) as %s using the %s method.",
|
||||
user->uuid.c_str(), user->GetIPString().c_str(), user->GetRealHost().c_str(),
|
||||
cloak.c_str(), cloakmethod->GetName());
|
||||
}
|
||||
ext.Set(user, cloaks);
|
||||
}
|
||||
|
@ -214,13 +214,10 @@ public:
|
||||
return {};
|
||||
|
||||
irc::sockets::sockaddrs sa(false);
|
||||
if (sa.from(user->GetRealHost()) && sa.addr() == user->client_sa.addr())
|
||||
if (!cloakhost || (sa.from(user->GetRealHost()) && sa.addr() == user->client_sa.addr()))
|
||||
return CloakAddress(user->client_sa);
|
||||
|
||||
if (cloakhost)
|
||||
return CloakHost(user->GetRealHost(), '.');
|
||||
|
||||
return {}; // Only reachable on hmac-sha256-ip.
|
||||
return CloakHost(user->GetRealHost(), '.');
|
||||
}
|
||||
|
||||
std::string Generate(const std::string& hostip) override
|
||||
|
Loading…
x
Reference in New Issue
Block a user