From f7768a00a0ffbab796361fed6b80a4bd29b091a9 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 5 Feb 2017 21:05:50 -0800 Subject: [PATCH 1/7] inspircd: work around extraneous letters sometimes sent in FJOIN TS Anope 1.8 potentially sends a trailing 'd' after the timestamp, which causes int() to error. This is technically valid in InspIRCd S2S because atoi() ignores non-digit characters, but it's strange behaviour either way: <- :3AX FJOIN #monitor 1485462109d + :,3AXAAAAAK Thansk to @koaxirc for reporting. (cherry picked from commit 663e657bf5a82d9c2d1a1f3e9a02709118dc796b) --- protocols/inspircd.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index d2a3a19..25a3cc7 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -539,8 +539,13 @@ class InspIRCdProtocol(TS6BaseProtocol): self.irc.channels[channel].users.add(user) - # Statekeeping with timestamps - their_ts = int(args[1]) + # Statekeeping with timestamps. Note: some service packages (Anope 1.8) send a trailing + # 'd' after the timestamp, which we should strip out to prevent int() from erroring. + # This is technically valid in InspIRCd S2S because atoi() ignores non-digit characters, + # but it's strange behaviour either way... + # <- :3AX FJOIN #monitor 1485462109d + :,3AXAAAAAK + their_ts = int(''.join(char for char in args[1] if char.isdigit())) + our_ts = self.irc.channels[channel].ts self.updateTS(servernumeric, channel, their_ts, changedmodes) From f70e771000decebf1c4837ac0d98bdde5ef44fbd Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 5 Feb 2017 22:23:20 -0800 Subject: [PATCH 2/7] unreal: ignore userpairs with only a prefix and no user How is this even possible?! Reported by @koaxirc. (cherry picked from commit 9fac7cb1f321e154f3b99038b5bc2c66fef15e31) --- protocols/unreal.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/protocols/unreal.py b/protocols/unreal.py index 1486c6d..06e5174 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -617,12 +617,18 @@ class UnrealProtocol(TS6BaseProtocol): else: r = re.search(r'([^\w]*)(.*)', userpair) user = r.group(2) + + if not user: + # Userpair with no user? Ignore. XXX: find out how this is even possible... + # <- :002 SJOIN 1486361658 #idlerpg :@ + continue + user = self._getUid(user) # Normalize nicks to UIDs for Unreal 3.2 links # Unreal uses slightly different prefixes in SJOIN. +q is * instead of ~, # and +a is ~ instead of &. modeprefix = (r.group(1) or '').replace("~", "&").replace("*", "~") finalprefix = '' - assert user, 'Failed to get the UID from %r; our regex needs updating?' % userpair + log.debug('(%s) handle_sjoin: got modeprefix %r for user %r', self.irc.name, modeprefix, user) for m in modeprefix: # Iterate over the mapping of prefix chars to prefixes, and From 223dd3bf7b60e8110b38713f0eb4687d8a41342a Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 17 Feb 2017 22:26:19 -0800 Subject: [PATCH 3/7] nefarious: fix a typo causing crash on user mode change (cherry picked from commit 3e4a980ea64652239aea0eab4aa39ee35a9e10cb) --- protocols/nefarious.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/nefarious.py b/protocols/nefarious.py index 6a88e31..9b47daa 100644 --- a/protocols/nefarious.py +++ b/protocols/nefarious.py @@ -433,7 +433,7 @@ class P10Protocol(IRCS2SProtocol): for wrapped_modes in self.irc.wrapModes(modes[:12], bufsize): self._send(numeric, 'M %s %s %s' % (real_target, wrapped_modes, ts)) else: - self._send(numeric, 'M %s %s%s' % (real_target, joinedmodes)) + self._send(numeric, 'M %s %s' % (real_target, joinedmodes)) modes = modes[12:] def nick(self, numeric, newnick): From 4577bde05c43e90b73f1b0d95e13692699b540f1 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 19 Feb 2017 21:40:00 -0800 Subject: [PATCH 4/7] example-conf: make the "permissions:" block migration note more prominent --- example-conf.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/example-conf.yml b/example-conf.yml index 84ad680..80eeaa4 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -49,8 +49,11 @@ login: # NOTE: for users migrating from PyLink < 1.1, the old login:user/login:password settings # have been deprecated. We strongly recommend migrating to the new "accounts:" block below, as # it supports multiple accounts, hashed passwords, and allows more flexibility (accounts no - # longer imply admin access). However, you must also add your account to the "permissions:" - # block below, or you will lose IRC administration access to your PyLink daemon! + # longer imply admin access). + + # IMPORTANT: If you're switching from login:user/login:password, you MUST ADD YOURSELF to a + # "permissions:" block like the one below, or you will lose IRC administration access to your + # PyLink daemon! accounts: # Creates an account with username "user1". You can define other usernames at the # same level here (key name is user name). From 46b18512cfac68344cd6c10c0004a0aa06644728 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 5 Feb 2017 21:46:36 -0800 Subject: [PATCH 5/7] relay: less ambiguous error if a relay channel doesn't exist on the caller network (cherry picked from commit 0b0efbaf9f49757c58aa9ec6a060f966e15e7677) --- plugins/relay.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/relay.py b/plugins/relay.py index c908b74..698937f 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -2016,7 +2016,8 @@ def claim(irc, source, args): relay = (irc.name, channel) with db_lock: if relay not in db: - irc.error('No such relay %r exists.' % channel) + irc.error('No relay %r exists on this network (this command must be run on the ' + 'network this channel was created on).' % channel) return claimed = db[relay]["claim"] try: From 6dd08e7dcb0f19e0e480426fcea2bc130b000164 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 24 Feb 2017 17:49:54 -0800 Subject: [PATCH 6/7] corecommands: remove extraneous irc.checkAuthenticated() call (cherry picked from commit fe3fa2872db4ef3692ce36416e75ff6e7ab8b665) --- coremods/corecommands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coremods/corecommands.py b/coremods/corecommands.py index b861681..36dbf07 100644 --- a/coremods/corecommands.py +++ b/coremods/corecommands.py @@ -110,7 +110,7 @@ def unload(irc, source, args): Unloads a currently loaded plugin.""" permissions.checkPermissions(irc, source, ['core.unload', 'core.reload']) - irc.checkAuthenticated(source, allowOper=False) + try: name = args[0] except IndexError: From 027c35b75a2112104fa2bf553ce0d702e730dba2 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 24 Feb 2017 17:56:43 -0800 Subject: [PATCH 7/7] PyLink 1.1.1 --- RELNOTES.md | 19 +++++++++++++++++++ VERSION | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/RELNOTES.md b/RELNOTES.md index 28a3036..8bdf0e2 100644 --- a/RELNOTES.md +++ b/RELNOTES.md @@ -1,3 +1,22 @@ +# PyLink 1.1.1 + +The "Crush" release. Changes from 1.1.0: + +#### Bug fixes +- The `pylink-mkpasswd` program is actually installed now when using `pip` (PyPI) or `setup.py`. +- Backported protocol module fixes from 1.2-dev: + - unreal: fix crashes when receiving `SJOIN` with only a prefix and no UID + - inspircd: work around extraneous letters sent in `FJOIN` timestamps (Anope 1.8.x bug) + - nefarious: fix a typo causing crashes on user mode changes +- Relay: in `claim`, show a less ambiguous error when a relay channel doesn't exist on the caller's network. +- corecommands: removed extraneous `irc.checkAuthenticated()` call + +#### Feature changes +- `pylink-mkpasswd` now supports interactive password input via getpass, which is more secure than passing passwords raw on the command line. + +#### Misc changes +- More prominent migration notes regarding permissions and new accounts system. + # PyLink 1.1.0 The "Calico" release. This is mostly a cleanup and documentation update from 1.1-beta2, with the following additional change: diff --git a/VERSION b/VERSION index 238afc2..524cb55 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0.1 +1.1.1