diff --git a/SOURCES/fix-typo-in-resolver.patch b/SOURCES/fix-typo-in-resolver.patch new file mode 100644 index 0000000..54c9c86 --- /dev/null +++ b/SOURCES/fix-typo-in-resolver.patch @@ -0,0 +1,22 @@ +From 84d3c7dffec9c0a380aa5f696ca728879dbe38ac Mon Sep 17 00:00:00 2001 +From: Martin Basti +Date: Fri, 29 Jan 2016 18:23:22 +0100 +Subject: [PATCH] Fix typo in resolver.py + +--- + dns/resolver.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dns/resolver.py b/dns/resolver.py +index 55359fa..b2ca999 100644 +--- a/dns/resolver.py ++++ b/dns/resolver.py +@@ -95,7 +95,7 @@ class NoNameservers(dns.exception.DNSException): + def _fmt_kwargs(self, **kwargs): + srv_msgs = [] + for err in kwargs['errors']: +- srv_msgs.append('Server %s %s port %s anwered %s' % (err[0], ++ srv_msgs.append('Server %s %s port %s answered %s' % (err[0], + 'TCP' if err[1] else 'UDP', err[2], err[3])) + return super(NoNameservers, self)._fmt_kwargs( + query=kwargs['request'].question, errors='; '.join(srv_msgs)) diff --git a/SOURCES/reject-lines-with-less-than-two-tokens.patch b/SOURCES/reject-lines-with-less-than-two-tokens.patch new file mode 100644 index 0000000..c3088e8 --- /dev/null +++ b/SOURCES/reject-lines-with-less-than-two-tokens.patch @@ -0,0 +1,26 @@ +From 13347e2450c7bfa928eb80b01850e52dfa095802 Mon Sep 17 00:00:00 2001 +From: Tomas Babej +Date: Thu, 28 Jan 2016 15:05:01 +0100 +Subject: [PATCH] resolver: Reject lines with less than two tokens + +--- + dns/resolver.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dns/resolver.py b/dns/resolver.py +index 55359fa..94360c4 100644 +--- a/dns/resolver.py ++++ b/dns/resolver.py +@@ -562,8 +562,11 @@ def read_resolv_conf(self, f): + if len(l) == 0 or l[0] == '#' or l[0] == ';': + continue + tokens = l.split() +- if len(tokens) == 0: ++ ++ # Any line containing less than 2 tokens is malformed ++ if len(tokens) < 2: + continue ++ + if tokens[0] == 'nameserver': + self.nameservers.append(tokens[1]) + elif tokens[0] == 'domain': diff --git a/SPECS/python-dns.spec b/SPECS/python-dns.spec index 43a414e..598ab98 100644 --- a/SPECS/python-dns.spec +++ b/SPECS/python-dns.spec @@ -4,7 +4,7 @@ Name: python-dns Version: 1.12.0 -Release: 2%{?from_checkout:.20150617git%{shortcommit}}%{?dist} +Release: 4%{?from_checkout:.20150617git%{shortcommit}}%{?dist} Summary: DNS toolkit for Python Group: Development/Languages @@ -16,6 +16,14 @@ Source0: https://github.com/rthalley/%{name}/archive/%{commit}.tar.gz Source0: http://www.dnspython.org/kits/%{version}/dnspython-%{version}.tar.gz %endif Patch0: incorrect-exception-to-udp-function.patch +# Reject lines with less than two tokens +# Fixed upstream: https://github.com/rthalley/dnspython/commit/13347e2450c7bfa928eb80b01850e52dfa095802 +# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1400934 +Patch1: reject-lines-with-less-than-two-tokens.patch +# Fix typo in resolver.py +# Fixed upstream: https://github.com/rthalley/dnspython/commit/84d3c7dffec9c0a380aa5f696ca728879dbe38ac +# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1440037 +Patch2: fix-typo-in-resolver.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -34,6 +42,8 @@ manipulation of DNS zones, messages, names, and records. %prep %setup -q -n rthalley-dnspython-%{?from_checkout:%{shortcommit}}%{!?from_checkout:%{version}} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 # strip executable permissions so that we don't pick up dependencies # from documentation @@ -64,6 +74,14 @@ mv test_resolver.py test_resolver.pynorun %changelog +* Wed Apr 19 2017 Charalampos Stratakis - 1.12.0-4 +- Fix typo in resolver.py +Resolves: rhbz#1440037 + +* Tue Feb 14 2017 Charalampos Stratakis - 1.12.0-3 +- Reject lines with less than two tokens +Resolves: rhbz#1400934 + * Tue Mar 08 2016 Charalampos Stratakis - 1.12.0-2 - Added patch to fix incorrect exception to udp function Resolves: rhbz#1312770