[Python-apps-commits] r1929 - in packages/pyzor/trunk/debian (3 files)
tklauser-guest at users.alioth.debian.org
tklauser-guest at users.alioth.debian.org
Sun Oct 26 17:56:25 UTC 2008
Date: Sunday, October 26, 2008 @ 17:56:23
Author: tklauser-guest
Revision: 1929
Fix bug #494047
Added:
packages/pyzor/trunk/debian/patches/09_check_discover_servers.dpatch
Modified:
packages/pyzor/trunk/debian/changelog
packages/pyzor/trunk/debian/patches/00list
Modified: packages/pyzor/trunk/debian/changelog
===================================================================
--- packages/pyzor/trunk/debian/changelog 2008-10-26 17:38:55 UTC (rev 1928)
+++ packages/pyzor/trunk/debian/changelog 2008-10-26 17:56:23 UTC (rev 1929)
@@ -1,11 +1,13 @@
pyzor (1:0.4.0+cvs20030201-9) unstable; urgency=low
* New maintainer (Closes: #416278).
+ * Check received server list for validity and print an error message when no
+ servers where discovered (Closes: #494047).
* Updated Standards-Version to 3.8.0.
* Removed Homepage tag in control in favour of the new control field.
* Added Vcs-Svn and Vcs-Browser control fields.
- -- Tobias Klauser <tklauser at access.unizh.ch> Sun, 26 Oct 2008 18:34:06 +0100
+ -- Tobias Klauser <tklauser at access.unizh.ch> Sun, 26 Oct 2008 18:52:23 +0100
pyzor (1:0.4.0+cvs20030201-8) unstable; urgency=low
Modified: packages/pyzor/trunk/debian/patches/00list
===================================================================
--- packages/pyzor/trunk/debian/patches/00list 2008-10-26 17:38:55 UTC (rev 1928)
+++ packages/pyzor/trunk/debian/patches/00list 2008-10-26 17:56:23 UTC (rev 1929)
@@ -6,3 +6,4 @@
06_add_log
07_handle_unknown_encodings
08_define_mbox
+09_check_discover_servers.dpatch
Added: packages/pyzor/trunk/debian/patches/09_check_discover_servers.dpatch
===================================================================
--- packages/pyzor/trunk/debian/patches/09_check_discover_servers.dpatch (rev 0)
+++ packages/pyzor/trunk/debian/patches/09_check_discover_servers.dpatch 2008-10-26 17:56:23 UTC (rev 1929)
@@ -0,0 +1,41 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 09_check_discover_servers.dpatch by Tobias Klauser <tklauser at access.unizh.ch>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Check whether the discovered servers really look like server adresses and
+## DP: print an error messages when no valid servers are found (Fixes #494047).
+
+ at DPATCH@
+diff -urpN pyzor-0.4.0+cvs20030201.orig/lib/pyzor/client.py pyzor-0.4.0+cvs20030201/lib/pyzor/client.py
+--- pyzor-0.4.0+cvs20030201.orig/lib/pyzor/client.py 2003-02-01 11:29:42.000000000 +0100
++++ pyzor-0.4.0+cvs20030201/lib/pyzor/client.py 2008-10-26 18:45:33.000000000 +0100
+@@ -10,6 +10,7 @@ import mimetools
+ import multifile
+ import sha
+ import threading
++import re
+
+ import pyzor
+ from pyzor import *
+@@ -113,7 +114,7 @@ class ServerList(list):
+ for line in serverfile:
+ orig_line = line
+ line = line.strip()
+- if line and not line.startswith('#'):
++ if line and not line.startswith('#') and re.match('[a-zA-Z0-9.-]+:[0-9]+', line):
+ self.append(pyzor.Address.from_str(line))
+
+
+@@ -172,6 +173,12 @@ class ExecCall(object):
+
+
+ self.servers = self.get_servers(servers_fn)
++ if len(servers) == 0:
++ sys.stderr.write("no valid servers found\n")
++ # Remove the servers file as it only contains invalid entries,
++ # probably a HTTP error message
++ os.unlink(servers_fn)
++ sys.exit(1)
+ self.client = Client(self.get_accounts(config.get_filename('client',
+ 'AccountsFile')))
+
Property changes on: packages/pyzor/trunk/debian/patches/09_check_discover_servers.dpatch
___________________________________________________________________
Name: svn:executable
+ *
More information about the Python-apps-commits
mailing list