summaryrefslogtreecommitdiff
path: root/modules/protocol
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-09 23:43:11 -0400
committerAdam <Adam@anope.org>2010-09-09 23:43:11 -0400
commit46813ccb8c6ab572b8a9ff0a39afb1d92dc4482b (patch)
tree562da502a102230ce207bbe921fdc978ee71e20c /modules/protocol
parentfdd196e50b4616ac377bd0ee0ae5ce6c57b657ee (diff)
Added an asynchronous DNS system and m_dnsbl, which checks clients against DNS blacklists.
Rewrote internal handling of IPs, we now properly support users using IPv6. Fixed a few problems with the UnrealIRCd protocol module.
Diffstat (limited to 'modules/protocol')
-rw-r--r--modules/protocol/bahamut.cpp5
-rw-r--r--modules/protocol/inspircd11.cpp7
-rw-r--r--modules/protocol/inspircd12.cpp5
-rw-r--r--modules/protocol/inspircd20.cpp5
-rw-r--r--modules/protocol/ratbox.cpp5
-rw-r--r--modules/protocol/unreal32.cpp21
6 files changed, 23 insertions, 25 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index ae65bd364..9938d33c7 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -34,7 +34,6 @@ IRCDVar myIrcd[] = {
0, /* vidents */
1, /* svshold */
1, /* time stamp on mode */
- 1, /* NICKIP */
0, /* O:LINE */
1, /* UMODE */
0, /* VHOST ON NICK */
@@ -451,7 +450,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
if (ac != 2)
{
- user = do_nick(source, av[0], av[4], av[5], av[6], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, Anope::string(av[8]).is_pos_number_only() ? convertTo<uint32>(av[8]) : 0, "", "");
+ user = do_nick(source, av[0], av[4], av[5], av[6], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, av[8], "", "");
if (user)
{
UserSetInternalModes(user, 1, &av[3]);
@@ -467,7 +466,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
}
else
- do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, 0, "", "");
+ do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "");
return MOD_CONT;
}
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index ebbedd362..042814465 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -35,7 +35,6 @@ IRCDVar myIrcd[] = {
1, /* vidents */
1, /* svshold */
0, /* time stamp on mode */
- 0, /* NICKIP */
1, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
@@ -714,11 +713,9 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
time_t ts = Anope::string(av[0]).is_pos_number_only() ? convertTo<time_t>(av[0]) : 0;
- user = do_nick("", av[1], av[4], av[2], source, av[7], ts, 0, av[3], "");
+ user = do_nick("", av[1], av[4], av[2], source, av[7], ts, av[6], av[3], "");
if (user)
{
- user->hostip = av[6];
-
UserSetInternalModes(user, 1, &av[5]);
user->SetCloakedHost(av[3]);
@@ -735,7 +732,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
}
else
- do_nick(source, av[0], "", "", "", "", 0, 0, "", "");
+ do_nick(source, av[0], "", "", "", "", 0, "", "", "");
return MOD_CONT;
}
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index 8b6c55907..0fec91e25 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -35,7 +35,6 @@ IRCDVar myIrcd[] = {
1, /* vidents */
1, /* svshold */
0, /* time stamp on mode */
- 0, /* NICKIP */
0, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
@@ -725,7 +724,7 @@ int anope_event_sethost(const Anope::string &source, int ac, const char **av)
int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
- do_nick(source, av[0], "", "", "", "", 0, 0, "", "");
+ do_nick(source, av[0], "", "", "", "", 0, "", "", "");
return MOD_CONT;
}
@@ -764,7 +763,7 @@ int anope_event_uid(const Anope::string &source, int ac, const char **av)
}
user = NULL;
- user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, 0, av[4], av[0]);
+ user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, av[6], av[4], av[0]);
if (user)
{
UserSetInternalModes(user, 1, &av[8]);
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index be7b7c760..4445b82b9 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -35,7 +35,6 @@ IRCDVar myIrcd[] = {
1, /* vidents */
1, /* svshold */
0, /* time stamp on mode */
- 0, /* NICKIP */
0, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
@@ -722,7 +721,7 @@ int anope_event_sethost(const Anope::string &source, int ac, const char **av)
int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
- do_nick(source, av[0], "", "", "", "", 0, 0, "", "");
+ do_nick(source, av[0], "", "", "", "", 0, "", "", "");
return MOD_CONT;
}
@@ -761,7 +760,7 @@ int anope_event_uid(const Anope::string &source, int ac, const char **av)
}
user = NULL;
- user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, 0, av[4], av[0]);
+ user = do_nick("", av[2], av[5], av[3], s->GetName(), av[ac - 1], ts, av[6], av[4], av[0]);
if (user)
{
UserSetInternalModes(user, 1, &av[8]);
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index db5c4d5bd..d43a80b52 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -34,7 +34,6 @@ IRCDVar myIrcd[] = {
0, /* vidents */
0, /* svshold */
0, /* time stamp on mode */
- 0, /* NICKIP */
0, /* UMODE */
0, /* O:LINE */
0, /* VHOST ON NICK */
@@ -405,7 +404,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
{
Server *s = Server::Find(source);
/* Source is always the server */
- user = do_nick("", av[0], av[4], av[5], s->GetName(), av[8], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, 0, "*", av[7]);
+ user = do_nick("", av[0], av[4], av[5], s->GetName(), av[8], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, av[6], "*", av[7]);
if (user)
{
UserSetInternalModes(user, 1, &av[3]);
@@ -421,7 +420,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
}
else if (ac == 2)
- do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, 0, "", "");
+ do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "");
return MOD_CONT;
}
diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp
index 047f51b15..fb12892e2 100644
--- a/modules/protocol/unreal32.cpp
+++ b/modules/protocol/unreal32.cpp
@@ -34,7 +34,6 @@ IRCDVar myIrcd[] = {
1, /* vidents */
1, /* svshold */
1, /* time stamp on mode */
- 1, /* NICKIP */
1, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
@@ -133,7 +132,7 @@ class UnrealIRCdProto : public IRCDProto
time_t timeleft = x->Expires - time(NULL);
if (timeleft > 172800)
timeleft = 172800;
- send_cmd("", "BD + G %s %s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(time(NULL) + timeleft), static_cast<long>(x->Expires), x->Reason.c_str());
+ send_cmd("", "BD + G %s %s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(time(NULL) + timeleft), static_cast<long>(x->Created), x->Reason.c_str());
}
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
@@ -175,7 +174,7 @@ class UnrealIRCdProto : public IRCDProto
void SendClientIntroduction(const Anope::string &nick, const Anope::string &user, const Anope::string &host, const Anope::string &real, const Anope::string &modes, const Anope::string &)
{
EnforceQlinedNick(nick, Config->ServerName);
- send_cmd("", "& %s 1 %ld %s %s %s 0 %s %s%s :%s", nick.c_str(), static_cast<long>(time(NULL)), user.c_str(), host.c_str(), Config->ServerName.c_str(), modes.c_str(), host.c_str(), myIrcd->nickip ? " *" : "", real.c_str());
+ send_cmd("", "& %s 1 %ld %s %s %s 0 %s %s * :%s", nick.c_str(), static_cast<long>(time(NULL)), user.c_str(), host.c_str(), Config->ServerName.c_str(), modes.c_str(), host.c_str(), real.c_str());
}
void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf)
@@ -860,11 +859,17 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
<codemastr> it's sent when a nick collision occurs
- so we have to leave it around for now -TSL
*/
- do_nick(source, av[0], av[3], av[4], av[5], av[6], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, 0, "*", "");
+ do_nick(source, av[0], av[3], av[4], av[5], av[6], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, "", "*", "");
}
else if (ac == 11)
{
- user = do_nick(source, av[0], av[3], av[4], av[5], av[10], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, ntohl(decode_ip(av[9])), av[8], "");
+ Anope::string decoded_ip;
+ b64_decode(av[9], decoded_ip);
+
+ sockaddrs ip;
+ ip.ntop(strlen(av[9]) == 8 ? AF_INET : AF_INET6, decoded_ip.c_str());
+
+ user = do_nick(source, av[0], av[3], av[4], av[5], av[10], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, ip.addr(), av[8], "");
if (user)
{
UserSetInternalModes(user, 1, &av[7]);
@@ -883,7 +888,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
else
{
/* NON NICKIP */
- user = do_nick(source, av[0], av[3], av[4], av[5], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, 0, av[8], "");
+ user = do_nick(source, av[0], av[3], av[4], av[5], av[9], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : 0, "", av[8], "");
if (user)
{
UserSetInternalModes(user, 1, &av[7]);
@@ -901,7 +906,7 @@ int anope_event_nick(const Anope::string &source, int ac, const char **av)
}
}
else
- do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, 0, "", "");
+ do_nick(source, av[0], "", "", "", "", Anope::string(av[1]).is_pos_number_only() ? convertTo<time_t>(av[1]) : 0, "", "", "");
return MOD_CONT;
}
@@ -1136,7 +1141,7 @@ void moduleAddIRCDMsgs()
Anope::AddMessage("PRIVMSG", anope_event_privmsg);
Anope::AddMessage("!", anope_event_privmsg);
Anope::AddMessage("QUIT", anope_event_quit);
- Anope::AddMessage("),", anope_event_quit);
+ Anope::AddMessage(",", anope_event_quit);
Anope::AddMessage("SERVER", anope_event_server);
Anope::AddMessage("'", anope_event_server);
Anope::AddMessage("SQUIT", anope_event_squit);