commit:     c1839c97223aa60fa40c2812c5fe625df2b60564
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 14 13:23:37 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Nov 14 13:23:37 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1839c97

net-misc/wget: fix dot-prefixed domain matching

Reported-by: Henning Schild <henning <AT> hennsch.de>
Closes: https://github.com/gentoo/gentoo/pull/10416
Package-Manager: Portage-2.3.51, Repoman-2.3.12
RepoMan-Options: --force
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 ...t-1.19.5-fix-dot-prefixed-domain-matching.patch | 33 ++++++++++++++++++++++
 .../{wget-1.19.5.ebuild => wget-1.19.5-r1.ebuild}  |  4 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git 
a/net-misc/wget/files/wget-1.19.5-fix-dot-prefixed-domain-matching.patch 
b/net-misc/wget/files/wget-1.19.5-fix-dot-prefixed-domain-matching.patch
new file mode 100644
index 00000000000..129f0b67541
--- /dev/null
+++ b/net-misc/wget/files/wget-1.19.5-fix-dot-prefixed-domain-matching.patch
@@ -0,0 +1,33 @@
+From fd85ac9cc623847e9d94d9f9241ab34e2c146cbf Mon Sep 17 00:00:00 2001
+From: Luiz Angelo Daros de Luca <[email protected]>
+Date: Thu, 25 Oct 2018 17:39:52 -0300
+Subject: [PATCH] * src/host.c (sufmatch): Fix dot-prefixed domain matching
+
+Current sufmatch does not match when domain is dot-prefixed.
+The example of no_proxy in man (.mit.edu) does use a dot-prefixed
+domain.
+
+Signed-off-by: Luiz Angelo Daros de Luca <[email protected]>
+Copyright-paperwork-exempt: Yes
+---
+ src/host.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/host.c b/src/host.c
+index b42cd6e8..2bf848f3 100644
+--- a/src/host.c
++++ b/src/host.c
+@@ -1033,8 +1033,9 @@ sufmatch (const char **list, const char *what)
+       /* Domain or subdomain match
+        * k == -1: exact match
+        * k >= 0 && what[k] == '.': subdomain match
++       * k >= 0 && list[i][0] == '.': dot-prefixed subdomain match
+        */
+-      if (j == -1 && (k == -1 || what[k] == '.'))
++      if (j == -1 && (k == -1 || what[k] == '.' || list[i][0] == '.'))
+         return true;
+     }
+ 
+-- 
+2.18.1
+

diff --git a/net-misc/wget/wget-1.19.5.ebuild 
b/net-misc/wget/wget-1.19.5-r1.ebuild
similarity index 96%
rename from net-misc/wget/wget-1.19.5.ebuild
rename to net-misc/wget/wget-1.19.5-r1.ebuild
index 15bbc380348..6db7c1194b0 100644
--- a/net-misc/wget/wget-1.19.5.ebuild
+++ b/net-misc/wget/wget-1.19.5-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -49,6 +49,8 @@ DEPEND="
 
 DOCS=( AUTHORS MAILING-LIST NEWS README doc/sample.wgetrc )
 
+PATCHES=( "${FILESDIR}"/${P}-fix-dot-prefixed-domain-matching.patch )
+
 pkg_setup() {
        use test && python-any-r1_pkg_setup
 }

Reply via email to