1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 05:53:12 +02:00

Don't enforce session limit on clients with no IP on Unreal, fix typo in /cs down syntax, fix os_session messages to reference ip

This commit is contained in:
Adam
2013-02-25 00:26:49 -05:00
parent 5d4db2b854
commit 8561941e22
5 changed files with 22 additions and 13 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ operserv
*
* This directive is optional, if not set, nothing will be sent.
*/
sessionlimitexceeded = "The session limit for your host %s has been exceeded."
sessionlimitexceeded = "The session limit for your IP %s has been exceeded."
/*
* Same as above, but should be used to provide a website address where users can find out more
+1 -1
View File
@@ -100,7 +100,7 @@ class CommandCSDown : public Command
CommandCSDown(Module *creator) : Command(creator, "chanserv/down", 0, 2)
{
this->SetDesc(_("Removes a selected nicks status from a channel"));
this->SetSyntax(_("[\037channel\037 ]\037nick\037]]"));
this->SetSyntax(_("[\037channel\037 [\037nick\037]]"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+4 -3
View File
@@ -652,7 +652,7 @@ class OSSession : public Module
if (OperServ)
{
if (!Config->SessionLimitExceeded.empty())
u->SendMessage(OperServ, Config->SessionLimitExceeded.c_str(), u->host.c_str());
u->SendMessage(OperServ, Config->SessionLimitExceeded.c_str(), u->ip.c_str());
if (!Config->SessionLimitDetailsLoc.empty())
u->SendMessage(OperServ, "%s", Config->SessionLimitDetailsLoc.c_str());
}
@@ -660,7 +660,7 @@ class OSSession : public Module
++session->hits;
if (Config->MaxSessionKill && session->hits >= Config->MaxSessionKill && akills)
{
const Anope::string &akillmask = "*@" + u->host;
const Anope::string &akillmask = "*@" + u->ip;
XLine *x = new XLine(akillmask, Config->OperServ, Anope::CurTime + Config->SessionAutoKillExpiry, "Session limit exceeded", XLineManager::GenerateUID());
akills->AddXLine(x);
akills->Send(NULL, x);
@@ -693,7 +693,7 @@ class OSSession : public Module
}
if (!session)
{
Log(LOG_DEBUG) << "Tried to delete non-existant session: " << u->host;
Log(LOG_DEBUG) << "Tried to delete non-existant session: " << u->ip;
return;
}
@@ -712,6 +712,7 @@ class OSSession : public Module
exception_type("Exception", Exception::Unserialize), ss(this), commandossession(this), commandosexception(this), akills("XLineManager", "xlinemanager/sgline")
{
this->SetAuthor("Anope");
this->SetPermanent(true);
Implementation i[] = { I_OnUserConnect, I_OnPreUserLogoff };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
+11 -8
View File
@@ -778,17 +778,20 @@ struct IRCDMessageNick : IRCDMessage
{
if (params.size() == 11)
{
Anope::string decoded_ip;
Anope::B64Decode(params[9], decoded_ip);
Anope::string ip;
try
if (params[9] != "*")
{
sockaddrs ip_addr;
ip_addr.ntop(params[9].length() == 8 ? AF_INET : AF_INET6, decoded_ip.c_str());
ip = ip_addr.addr();
Anope::string decoded_ip;
Anope::B64Decode(params[9], decoded_ip);
try
{
sockaddrs ip_addr;
ip_addr.ntop(params[9].length() == 8 ? AF_INET : AF_INET6, decoded_ip.c_str());
ip = ip_addr.addr();
}
catch (const SocketException &ex) { }
}
catch (const SocketException &ex) { }
Anope::string vhost = params[8];
if (vhost.equals_cs("*"))
+5
View File
@@ -148,6 +148,11 @@ void sockaddrs::pton(int type, const Anope::string &address, int pport)
void sockaddrs::ntop(int type, const void *src)
{
char buf[INET6_ADDRSTRLEN];
if (inet_ntop(type, src, buf, sizeof(buf)) != buf)
throw SocketException("Invalid addr");
switch (type)
{
case AF_INET: