From 9448bc86fd49ab1c736c3c83c56b4ee57da58895 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 4 Aug 2016 12:55:24 -0700 Subject: [PATCH] Protocol: abort when receiving SQUIT to our own server --- classes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes.py b/classes.py index cb3f3cc..9c4e2ed 100644 --- a/classes.py +++ b/classes.py @@ -1285,10 +1285,15 @@ class Protocol(): def _squit(self, numeric, command, args): """Handles incoming SQUITs.""" - # <- ABAAE SQ nefarious.midnight.vpn 0 :test split_server = self._getSid(args[0]) + # Normally we'd only need to check for our SID as the SQUIT target, but Nefarious + # actually uses the uplink server as the SQUIT target. + # <- ABAAE SQ nefarious.midnight.vpn 0 :test + if split_server in (self.irc.sid, self.irc.uplink): + raise ProtocolError('SQUIT received: (reason: %s)' % args[-1]) + affected_users = [] affected_nicks = [] log.debug('(%s) Splitting server %s (reason: %s)', self.irc.name, split_server, args[-1])