From 838ea6bfc4a4e754264db1f713a7abefd827d652 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 7 Sep 2016 20:37:57 -0700 Subject: [PATCH] relay: skip iterating over modetype definitions during reverse mode lookup This fixes a bug when setting +l on UnrealIRCd, where the type C mode definition is coincidentally also equal to 'l'. Reported by kevin via IRC. --- plugins/relay.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/relay.py b/plugins/relay.py index 147ca93..1d9e410 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -578,6 +578,10 @@ def getSupportedUmodes(irc, remoteirc, modes): # Iterate over all supported user modes for the current network. for name, m in irc.umodes.items(): + if name.startswith('*'): + # XXX: Okay, we need a better place to store modetypes. + continue + supported_char = None # Mode character matches one in our list, so set that named mode @@ -740,7 +744,12 @@ def getSupportedCmodes(irc, remoteirc, channel, modes): # this mode, and what its mode char for it is (if it is different). for name, m in irc.cmodes.items(): supported_char = None + if name.startswith('*'): + # XXX: Okay, we need a better place to store modetypes. + continue + if modechar == m: + supported_char = remoteirc.cmodes.get(name) if supported_char is None: