From 599f80ec5f7c78beeee7017f6c2677e6814d66c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Terje=20Ho=C3=A5s?= Date: Wed, 25 Sep 2013 10:18:10 +0200 Subject: [PATCH 1/7] Google: Filter out [, before attempting to interpret Googles response as json. --- plugins/Google/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index 348cfbc87..cfc34b077 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -267,6 +267,8 @@ class Google(callbacks.PluginRegexp): while ',,' in result: result = result.replace(',,', ',null,') + while '[,' in result: + result = result.replace('[,', '[') data = json.loads(result) try: From 46f5cd98b32da9d5222cc60a476968fb80326e10 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Wed, 25 Sep 2013 11:04:48 +0200 Subject: [PATCH 2/7] Clean up .gitignore --- .gitignore | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 7b1e282f2..da6336b17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,23 @@ -backup -build -dist -supybot.egg-info -test-data -test-conf -test-logs +*.mo *.pyc -docs/_build -docs/plugins -*.swp *.swo *~ -*.mo +.*.s[a-w][a-p] +.s[a-w][a-p] +MANIFEST +backup/ +build/ debian/limnoria* debian/python-module-stampdir/ dist/ -push.sh +docs/_build/ +docs/plugins/ +limnoria.egg-info/ merge.sh -src/version.py -MANIFEST +push.sh py3k/ +src/version.py +supybot.egg-info/ +test-conf/ +test-data/ +test-logs/ From f0050b95b97781a9e41527e9bfe4548b9a553bef Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Wed, 25 Sep 2013 11:43:31 +0200 Subject: [PATCH 3/7] Fix previous commit --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index da6336b17..7697aa217 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.mo -*.pyc -*.swo +*.py[co] *~ .*.s[a-w][a-p] .s[a-w][a-p] From f760d54d7d16b62c6c2c53d2dfd88d80cd996841 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Wed, 25 Sep 2013 11:44:14 +0200 Subject: [PATCH 4/7] I forgot this one... Who uses Emacs anyway? --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7697aa217..9a9416fdd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +#*# *.mo *.py[co] *~ From 359d3c633d23d9b905f6528ff9fa4f2eccde1222 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 6 Oct 2013 14:26:03 +0000 Subject: [PATCH 5/7] registry: Make subvalues inherit privacy. Closes GH-519. --- src/registry.py | 4 +++- test/test_registry.py | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/registry.py b/src/registry.py index 8519a6f66..1bce02c13 100644 --- a/src/registry.py +++ b/src/registry.py @@ -252,7 +252,9 @@ class Group(object): if not isValidRegistryName(name): raise InvalidRegistryName, name if node is None: - node = Group() + node = Group(private=self._private) + else: + node._private = node._private or self._private # We tried in any number of horrible ways to make it so that # re-registering something would work. It doesn't, plain and simple. # For the longest time, we had an "Is this right?" comment here, but diff --git a/test/test_registry.py b/test/test_registry.py index fb43c5572..b59f02daf 100644 --- a/test/test_registry.py +++ b/test/test_registry.py @@ -199,4 +199,29 @@ class ValuesTestCase(SupyTestCase): self.assertEqual(v(), 'bar') self.assertEqual(v(), 'foo') +class SecurityTestCase(SupyTestCase): + def testPrivate(self): + v = registry.String('foo', 'help') + self.assertFalse(v._private) + v = registry.String('foo', 'help', private=True) + self.assertTrue(v._private) + + g = registry.Group('foo') + v = registry.String('foo', 'help') + g.register('val', v) + self.assertFalse(g._private) + self.assertFalse(g.val._private) + + g = registry.Group('foo', private=True) + v = registry.String('foo', 'help') + g.register('val', v) + self.assertTrue(g._private) + self.assertTrue(g.val._private) + + g = registry.Group('foo') + v = registry.String('foo', 'help', private=True) + g.register('val', v) + self.assertFalse(g._private) + self.assertTrue(g.val._private) + # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: From 677f7fdd6fe4d119aa36a468d856d8957601f456 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 10 Oct 2013 14:10:06 +0000 Subject: [PATCH 6/7] irclib: Prevent crash if 324 or 329 is not received after any other post-join messages. --- src/irclib.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/irclib.py b/src/irclib.py index eed0fbbff..d640ffc36 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -532,7 +532,11 @@ class IrcState(IrcCommandDispatcher): def do324(self, irc, msg): channel = msg.args[1] - chan = self.channels[channel] + try: + chan = self.channels[channel] + except KeyError: + chan = ChannelState() + self.channels[channel] = chan for (mode, value) in ircutils.separateModes(msg.args[2:]): modeChar = mode[1] if mode[0] == '+' and mode[1] not in 'ovh': @@ -543,7 +547,11 @@ class IrcState(IrcCommandDispatcher): def do329(self, irc, msg): # This is the last part of an empty mode. channel = msg.args[1] - chan = self.channels[channel] + try: + chan = self.channels[channel] + except KeyError: + chan = ChannelState() + self.channels[channel] = chan chan.created = int(msg.args[2]) def doPart(self, irc, msg): From a67b31c9eaeb1fe04e736d6de6d2a40974578c13 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Wed, 23 Oct 2013 13:42:02 +0000 Subject: [PATCH 7/7] Aka: Fix typo (Error, not error). --- plugins/Aka/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Aka/plugin.py b/plugins/Aka/plugin.py index 293e18431..c0823d2b0 100644 --- a/plugins/Aka/plugin.py +++ b/plugins/Aka/plugin.py @@ -47,7 +47,7 @@ try: import sqlalchemy.ext import sqlalchemy.ext.declarative except ImportError: - raise callbacks.error('You have to install python-sqlalchemy in order ' + raise callbacks.Error('You have to install python-sqlalchemy in order ' 'to load this plugin.') if sqlalchemy: