Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/wget/, net-misc/wget/files/
Date: Wed, 02 Mar 2016 05:33:54
Message-Id: 1456896810.885437bfa2b7d96e6aa6dc846f0123051496b5d3.vapier@gentoo
1 commit: 885437bfa2b7d96e6aa6dc846f0123051496b5d3
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 2 05:31:17 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 2 05:33:30 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=885437bf
7
8 net-misc/wget: add upstream fix for progress bar #410529 and use subslots w/openssl #576128 and w/gnutls #573936
9
10 .../wget/files/wget-1.17.1-progress-bar-segv.patch | 35 ++++++++
11 net-misc/wget/wget-1.17.1-r1.ebuild | 94 ++++++++++++++++++++++
12 2 files changed, 129 insertions(+)
13
14 diff --git a/net-misc/wget/files/wget-1.17.1-progress-bar-segv.patch b/net-misc/wget/files/wget-1.17.1-progress-bar-segv.patch
15 new file mode 100644
16 index 0000000..5cfd41f
17 --- /dev/null
18 +++ b/net-misc/wget/files/wget-1.17.1-progress-bar-segv.patch
19 @@ -0,0 +1,35 @@
20 +From 7099f4899880eaefc2c40a3dc7693ab4174a819b Mon Sep 17 00:00:00 2001
21 +From: Darshit Shah <darnir@×××××.com>
22 +Date: Mon, 22 Feb 2016 15:08:15 +0100
23 +Subject: [PATCH] Sanitize value sent to memset to prevent SEGFAULT
24 +
25 +---
26 + src/progress.c | 5 +++++
27 + 1 file changed, 5 insertions(+)
28 +
29 +diff --git a/src/progress.c b/src/progress.c
30 +index 93f6246..8a5df21 100644
31 +--- a/src/progress.c
32 ++++ b/src/progress.c
33 +@@ -1164,6 +1164,8 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
34 + }
35 +
36 + padding = bp->width - count_cols (bp->buffer);
37 ++ assert (padding > 0 && "Padding length became non-positive!");
38 ++ padding = padding > 0 ? padding : 0;
39 + memset (p, ' ', padding);
40 + p += padding;
41 + *p = '\0';
42 +@@ -1174,6 +1176,9 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
43 + * from the release code since we do not want Wget to crash and burn when the
44 + * assertion fails. Instead Wget should continue downloading and display a
45 + * horrible and irritating progress bar that spams the screen with newlines.
46 ++ *
47 ++ * By default, all assertions are disabled in a Wget build and are enabled
48 ++ * only with the --enable-assert configure option.
49 + */
50 + assert (count_cols (bp->buffer) == bp->width);
51 + }
52 +--
53 +2.6.2
54 +
55
56 diff --git a/net-misc/wget/wget-1.17.1-r1.ebuild b/net-misc/wget/wget-1.17.1-r1.ebuild
57 new file mode 100644
58 index 0000000..7959314
59 --- /dev/null
60 +++ b/net-misc/wget/wget-1.17.1-r1.ebuild
61 @@ -0,0 +1,94 @@
62 +# Copyright 1999-2016 Gentoo Foundation
63 +# Distributed under the terms of the GNU General Public License v2
64 +# $Id$
65 +
66 +EAPI="5"
67 +
68 +PYTHON_COMPAT=( python{3_3,3_4} )
69 +
70 +inherit flag-o-matic python-any-r1 toolchain-funcs eutils
71 +
72 +DESCRIPTION="Network utility to retrieve files from the WWW"
73 +HOMEPAGE="https://www.gnu.org/software/wget/"
74 +SRC_URI="mirror://gnu/wget/${P}.tar.xz"
75 +
76 +LICENSE="GPL-3"
77 +SLOT="0"
78 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
79 +IUSE="debug gnutls idn ipv6 libressl nls ntlm pcre +ssl static test uuid zlib"
80 +REQUIRED_USE=" ntlm? ( !gnutls ssl ) gnutls? ( ssl )"
81 +
82 +LIB_DEPEND="idn? ( net-dns/libidn[static-libs(+)] )
83 + pcre? ( dev-libs/libpcre[static-libs(+)] )
84 + ssl? (
85 + gnutls? ( net-libs/gnutls:0=[static-libs(+)] )
86 + !gnutls? (
87 + !libressl? ( dev-libs/openssl:0=[static-libs(+)] )
88 + libressl? ( dev-libs/libressl[static-libs(+)] )
89 + )
90 + )
91 + uuid? ( sys-apps/util-linux[static-libs(+)] )
92 + zlib? ( sys-libs/zlib[static-libs(+)] )"
93 +RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
94 +DEPEND="${RDEPEND}
95 + app-arch/xz-utils
96 + virtual/pkgconfig
97 + static? ( ${LIB_DEPEND} )
98 + test? (
99 + ${PYTHON_DEPS}
100 + dev-lang/perl
101 + dev-perl/HTTP-Daemon
102 + dev-perl/HTTP-Message
103 + dev-perl/IO-Socket-SSL
104 + )
105 + nls? ( sys-devel/gettext )"
106 +
107 +DOCS=( AUTHORS MAILING-LIST NEWS README doc/sample.wgetrc )
108 +
109 +pkg_setup() {
110 + use test && python-any-r1_pkg_setup
111 +}
112 +
113 +src_prepare() {
114 + epatch "${FILESDIR}"/${P}-progress-bar-segv.patch
115 +}
116 +
117 +src_configure() {
118 + # fix compilation on Solaris, we need filio.h for FIONBIO as used in
119 + # the included gnutls -- force ioctl.h to include this header
120 + [[ ${CHOST} == *-solaris* ]] && append-cppflags -DBSD_COMP=1
121 +
122 + if use static ; then
123 + append-ldflags -static
124 + tc-export PKG_CONFIG
125 + PKG_CONFIG+=" --static"
126 + fi
127 + econf \
128 + --disable-assert \
129 + --disable-rpath \
130 + $(use_with ssl ssl $(usex gnutls gnutls openssl)) \
131 + $(use_enable ssl opie) \
132 + $(use_enable ssl digest) \
133 + $(use_enable idn iri) \
134 + $(use_enable ipv6) \
135 + $(use_enable nls) \
136 + $(use_enable ntlm) \
137 + $(use_enable pcre) \
138 + $(use_enable debug) \
139 + $(use_with uuid libuuid) \
140 + $(use_with zlib)
141 +}
142 +
143 +src_test() {
144 + emake check
145 +}
146 +
147 +src_install() {
148 + default
149 +
150 + sed -i \
151 + -e "s:/usr/local/etc:${EPREFIX}/etc:g" \
152 + "${ED}"/etc/wgetrc \
153 + "${ED}"/usr/share/man/man1/wget.1 \
154 + "${ED}"/usr/share/info/wget.info
155 +}