From 075c1d141dd34b8aaae06da49161d1b1b8a61161 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 9 Jun 2021 20:19:26 -0700 Subject: [PATCH] relay: sanitize idents on hybrid further --- plugins/relay.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index 619a158..153fdb7 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -407,9 +407,11 @@ def spawn_relay_user(irc, remoteirc, user, times_tagged=0, reuse_sid=None): # Truncate idents at 10 characters, because TS6 won't like them otherwise! ident = ident[:10] - # HACK: hybrid will reject idents that start with a "-". why??? - if remoteirc.protoname == 'hybrid' and ident.startswith('-'): - ident = 'r' + ident + # HACK: hybrid will reject idents that start with a symbol + if remoteirc.protoname == 'hybrid': + goodchars = tuple(string.ascii_letters + string.digits + '~') + if not ident.startswith(goodchars): + ident = 'r' + ident # Normalize hostnames host = normalize_host(remoteirc, userobj.host)