Skip to content
Permalink
Browse files

Allow post-handshake SASL in UnrealIRCd 4.2.2 and up.

This updates the unreal4 protocol module to work with both pseudo-id's
and real UID's. Something that will also be necessary once UnrealIRCd
gets rid of pseudo-id's altogether.
  • Loading branch information...
syzop authored and Adam- committed Feb 9, 2019
1 parent 2b8072b commit da6e2730c259d6d6356a0a948e85730ae34663ab
Showing with 27 additions and 6 deletions.
  1. +27 −6 modules/protocol/unreal4.cpp
@@ -373,18 +373,40 @@ class UnrealIRCdProto : public IRCDProto
void SendSASLMessage(const SASL::Message &message) anope_override
{
size_t p = message.target.find('!');
Anope::string distmask;

if (p == Anope::string::npos)
return;
{
Server *s = Server::Find(message.target.substr(0, 3));
if (!s)
return;
distmask = s->GetName();
}
else
{
distmask = message.target.substr(0, p);
}

UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << message.target.substr(0, p) << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext);
UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << distmask << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext);
}

void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
{
size_t p = uid.find('!');
Anope::string distmask;

if (p == Anope::string::npos)
return;
UplinkSocket::Message(Me) << "SVSLOGIN " << uid.substr(0, p) << " " << uid << " " << acc;
{
Server *s = Server::Find(uid.substr(0, 3));
if (!s)
return;
distmask = s->GetName();
}
else
{
distmask = uid.substr(0, p);
}
UplinkSocket::Message(Me) << "SVSLOGIN " << distmask << " " << uid << " " << acc;
}

bool IsIdentValid(const Anope::string &ident) anope_override
@@ -1005,8 +1027,7 @@ struct IRCDMessageSASL : IRCDMessage

void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
size_t p = params[1].find('!');
if (!SASL::sasl || p == Anope::string::npos)
if (!SASL::sasl)
return;

SASL::Message m;

0 comments on commit da6e273

Please sign in to comment.
You can’t perform that action at this time.