Merge lp:~stefanor/ibid/logging-388352 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Merged
Approved by: Stefano Rivera
Approved revision: 669
Merged at revision: 681
Proposed branch: lp:~stefanor/ibid/logging-388352
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~stefanor/ibid/logging-388352
Reviewer Review Type Date Requested Status
Michael Gorven Approve
Jonathan Hitchcock Approve
Review via email: mp+7724@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

Why shouldn't usernames contain spaces?

Revision history for this message
Stefano Rivera (stefanor) wrote :

> Why shouldn't usernames contain spaces?

Why should it? It seems like it would rarely be a good idea, and that gets rid of a whole pile of random port probing problems.

Revision history for this message
Jonathan Hitchcock (vhata) wrote :

The space-in-username thing is not ideal, but it's the easiest way to stop port-probers from setting random factoids (or something), and it's just on the telnet debugging-source.

review: Approve
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
Stefano Rivera (stefanor) wrote :

> > Why shouldn't usernames contain spaces?
>
> Why should it? It seems like it would rarely be a good idea, and that gets rid
> of a whole pile of random port probing problems.

To clarify:
1st: most of our plugins use (\S+) to grab usernames
2nd: it will eliminate just about every common text based protocol (i.e. at least HTTP and SMTP) from causing shit
3rd: telnet is for debugging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/log.py'
2--- ibid/plugins/log.py 2009-05-01 12:22:37 +0000
3+++ ibid/plugins/log.py 2009-06-20 18:27:41 +0000
4@@ -22,8 +22,8 @@
5 when = localtime(when)
6 if ibid.sources[source].type == 'jabber':
7 channel = channel.split('/')[0]
8- filename = self.log % { 'source': source,
9- 'channel': channel,
10+ filename = self.log % { 'source': source.replace('/', '-'),
11+ 'channel': channel.replace('/', '-'),
12 'year': when[0],
13 'month': when[1],
14 'day': when[2],
15
16=== modified file 'ibid/source/telnet.py'
17--- ibid/source/telnet.py 2009-02-23 20:29:44 +0000
18+++ ibid/source/telnet.py 2009-06-20 18:38:20 +0000
19@@ -18,6 +18,12 @@
20
21 def telnet_User(self, line):
22 self.user = unicode(line.strip(), 'utf-8', 'replace')
23+ if ' ' in self.user:
24+ self.transport.write('Sorry, no spaces allowed in usernames\r\n')
25+ self.factory.log.info(u"Rejected connection from %s", self.user)
26+ self.transport.loseConnection()
27+ return
28+
29 self.factory.log.info(u"Connection established with %s", self.user)
30 return 'Query'
31

Subscribers

People subscribed via source and target branches