3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-11 12:42:34 +01:00

relay: sanitize idents on hybrid further

This commit is contained in:
James Lu 2021-06-09 20:19:26 -07:00
parent d94593e4f6
commit 075c1d141d

View File

@ -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)