diff options
author | Adam <Adam@anope.org> | 2016-07-25 22:27:30 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-07-25 22:27:30 -0400 |
commit | 8fdfa6e094ebddc9698ca6245227857e4e27f06b (patch) | |
tree | 0fc0a2b8e9cd881074c1a53b467eb4d7fe070ba1 /modules/protocol/charybdis.cpp | |
parent | dad4be050b70efcfe844d6852aef8f351323429e (diff) |
Fix #1684 more, can have non-user sources for encap sasl
Diffstat (limited to 'modules/protocol/charybdis.cpp')
-rw-r--r-- | modules/protocol/charybdis.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp index c43a290bc..68bbe12b8 100644 --- a/modules/protocol/charybdis.cpp +++ b/modules/protocol/charybdis.cpp @@ -198,25 +198,30 @@ struct IRCDMessageEncap : IRCDMessage IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); - SetFlag(IRCDMESSAGE_REQUIRE_USER); } void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.GetUser(); - // In a burst, states that the source user is logged in as the account. if (params[1] == "LOGIN" || params[1] == "SU") { + User *u = source.GetUser(); NickCore *nc = NickCore::Find(params[2]); - if (!nc) + + if (!u || !nc) return; + u->Login(nc); } // Received: :42XAAAAAE ENCAP * CERTFP :3f122a9cc7811dbad3566bf2cec3009007c0868f - if (params[1] == "CERTFP") + else if (params[1] == "CERTFP") { + User *u = source.GetUser(); + if (!u) + return; + u->fingerprint = params[2]; + FOREACH_MOD(OnFingerprint, (u)); } /* @@ -230,7 +235,7 @@ struct IRCDMessageEncap : IRCDMessage * * Charybdis only accepts messages from SASL agents; these must have umode +S */ - if (params[1] == "SASL" && SASL::sasl && params.size() >= 6) + else if (params[1] == "SASL" && SASL::sasl && params.size() >= 6) { SASL::Message m; m.source = params[2]; |