Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
net-misc/wget: update to 1.21.2
Browse files Browse the repository at this point in the history
Update net-misc/wget to 1.21.2, mainly to address CVE-2021-31879.
  • Loading branch information
dongsupark committed Oct 28, 2021
1 parent 7fcc878 commit aecbf04
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 25 deletions.
3 changes: 2 additions & 1 deletion net-misc/wget/Manifest
@@ -1 +1,2 @@
DIST wget-1.20.3.tar.gz 4489249 BLAKE2B 89fa7997a02be6fb1a869d1bf359ce4e43b41f8069d1520e6d0b48739b9b6030b1dec7b7e8cbe833ea1070b30f551b1a9d72c6f4a43bb58df20b680b42a68805 SHA512 e8b82b40e270296228094a78d47f81580bdbdea9e6b93fd61b37dccb39430aeb9bda5397dc53a31c952a61629383c7e2a8c8abf414c8a4dd369af6ecf2717e6c
DIST wget-1.21.1.tar.gz 4884887 BLAKE2B 28a3044f33df1d24e13900e8018a38cabae21fb41dd2e089bdbfd759b4adee3771ab558b84f5a8b6f546bc84a3387c973903f9fe06562093d3566e22d1528587 SHA512 784efbf9fe43a1671109e32a9c36237eb2d5c19cf756bf6f6e65517fb21464d3d94b1d6f491852d23b3ddff63e38fe6b60df9125c91b139993af59875e3a0712
DIST wget-1.21.2.tar.gz 5004576 BLAKE2B e11c3a2b89ab26834dc4cbb445bcc6122d3a6b2a5b9c6de1ce9e8f062281f9e5aa1f80ca37a44791ba5aaf6a447015a26afef2199cdb75f1931d5e1ffb1f406b SHA512 3e35f92604486ca459f26df97d392579f1d83a9254519e8ce249b410bacf70dddf716d6caa3b29fd4865163f60410b2b8ad1ca1f7bb3dbb2456386b7647b988d
3 changes: 2 additions & 1 deletion net-misc/wget/metadata.xml
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>base-system@gentoo.org</email>
<name>Gentoo Base System</name>
</maintainer>
<use>
<flag name="cookie_check">Enable cookie checks via <pkg>net-libs/libpsl</pkg></flag>
<flag name="metalink">Enable support for <pkg>media-libs/libmetalink</pkg></flag>
<flag name="ntlm">Enable support for NTLM (Windows-based) authorization</flag>
<flag name="uuid">Generate UUIDs for the WARC (Web ARChive file format) using libuuid; otherwise use a simple RNG (random number generator)</flag>
</use>
Expand Down
@@ -1,9 +1,9 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{5,6,7} )
PYTHON_COMPAT=( python3_{7..9} )

inherit flag-o-matic python-any-r1 toolchain-funcs

Expand All @@ -13,21 +13,20 @@ SRC_URI="mirror://gnu/wget/${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="cookie_check debug gnutls idn ipv6 libressl nls ntlm pcre +ssl static test uuid zlib"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="cookie_check debug gnutls idn ipv6 metalink nls ntlm pcre +ssl static test uuid zlib"
REQUIRED_USE=" ntlm? ( !gnutls ssl ) gnutls? ( ssl )"
RESTRICT="!test? ( test )"

# Force a newer libidn2 to avoid libunistring deps. #612498
LIB_DEPEND="
cookie_check? ( net-libs/libpsl )
idn? ( >=net-dns/libidn2-0.14:=[static-libs(+)] )
metalink? ( media-libs/libmetalink )
pcre? ( dev-libs/libpcre2[static-libs(+)] )
ssl? (
gnutls? ( net-libs/gnutls:0=[static-libs(+)] )
!gnutls? (
!libressl? ( dev-libs/openssl:0=[static-libs(+)] )
libressl? ( dev-libs/libressl:0=[static-libs(+)] )
)
!gnutls? ( dev-libs/openssl:0=[static-libs(+)] )
)
uuid? ( sys-apps/util-linux[static-libs(+)] )
zlib? ( sys-libs/zlib[static-libs(+)] )
Expand Down Expand Up @@ -76,6 +75,12 @@ src_configure() {
# the included gnutls -- force ioctl.h to include this header
[[ ${CHOST} == *-solaris* ]] && append-cppflags -DBSD_COMP=1

if [[ ${CHOST} == *-darwin* ]] ; then
# https://lists.gnu.org/archive/html/bug-findutils/2021-01/msg00050.html
# https://lists.gnu.org/archive/html/bug-findutils/2021-01/msg00051.html
append-cppflags '-D__nonnull\(X\)='
fi

if use static ; then
append-ldflags -static
tc-export PKG_CONFIG
Expand All @@ -102,6 +107,7 @@ src_configure() {
$(use_enable ssl opie)
$(use_with cookie_check libpsl)
$(use_with idn libidn)
$(use_with metalink)
$(use_with ssl ssl $(usex gnutls gnutls openssl))
$(use_with uuid libuuid)
$(use_with zlib)
Expand Down
@@ -1,9 +1,9 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
EAPI=7

PYTHON_COMPAT=( python3_{5,6,7} )
PYTHON_COMPAT=( python3_{7..9} )

inherit flag-o-matic python-any-r1 toolchain-funcs

Expand All @@ -13,29 +13,27 @@ SRC_URI="mirror://gnu/wget/${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="debug gnutls idn ipv6 libressl nls ntlm pcre +ssl static test uuid zlib"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="cookie_check debug gnutls idn ipv6 metalink nls ntlm pcre +ssl static test uuid zlib"
REQUIRED_USE=" ntlm? ( !gnutls ssl ) gnutls? ( ssl )"
RESTRICT="!test? ( test )"

# Force a newer libidn2 to avoid libunistring deps. #612498
LIB_DEPEND="
cookie_check? ( net-libs/libpsl )
idn? ( >=net-dns/libidn2-0.14:=[static-libs(+)] )
metalink? ( media-libs/libmetalink )
pcre? ( dev-libs/libpcre2[static-libs(+)] )
ssl? (
gnutls? ( net-libs/gnutls:0=[static-libs(+)] )
!gnutls? (
!libressl? ( dev-libs/openssl:0=[static-libs(+)] )
libressl? ( dev-libs/libressl:0=[static-libs(+)] )
)
!gnutls? ( dev-libs/openssl:0=[static-libs(+)] )
)
uuid? ( sys-apps/util-linux[static-libs(+)] )
zlib? ( sys-libs/zlib[static-libs(+)] )
"
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
DEPEND="
${RDEPEND}
app-arch/xz-utils
virtual/pkgconfig
static? ( ${LIB_DEPEND} )
test? (
${PYTHON_DEPS}
Expand All @@ -44,6 +42,10 @@ DEPEND="
dev-perl/HTTP-Message
dev-perl/IO-Socket-SSL
)
"
BDEPEND="
app-arch/xz-utils
virtual/pkgconfig
nls? ( sys-devel/gettext )
"

Expand All @@ -66,6 +68,14 @@ src_prepare() {
-e 's/^ LIBICONV=$/:/' \
configure || die
fi

if [[ ${CHOST} == *-darwin* && ${CHOST##*-darwin} -le 17 ]] ; then
# Fix older Darwin inline definition problem
# fixed upstream
# https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=29d79d473f52b0ec58f50c95ef782c66fc0ead21
sed -i -e '/define _GL_EXTERN_INLINE_STDHEADER_BUG/s/_BUG/_DISABLE/' \
src/config.h.in || die
fi
}

src_configure() {
Expand All @@ -88,7 +98,6 @@ src_configure() {
--disable-pcre
--disable-rpath
--without-included-libunistring
--without-libpsl
--without-libunistring-prefix
$(use_enable debug)
$(use_enable idn iri)
Expand All @@ -98,7 +107,9 @@ src_configure() {
$(use_enable pcre pcre2)
$(use_enable ssl digest)
$(use_enable ssl opie)
$(use_with cookie_check libpsl)
$(use_with idn libidn)
$(use_with metalink)
$(use_with ssl ssl $(usex gnutls gnutls openssl))
$(use_with uuid libuuid)
$(use_with zlib)
Expand All @@ -112,8 +123,8 @@ src_install() {

sed -i \
-e "s:/usr/local/etc:${EPREFIX}/etc:g" \
"${ED%/}"/etc/wgetrc \
"${ED%/}"/usr/share/man/man1/wget.1 \
"${ED%/}"/usr/share/info/wget.info \
"${ED}"/etc/wgetrc \
"${ED}"/usr/share/man/man1/wget.1 \
"${ED}"/usr/share/info/wget.info \
|| die
}

1 comment on commit aecbf04

@thesamesam
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure CVE-2021-31879 was fixed? Do you happen to know which commit for us upstream? Our bug tracking this is here.

Please sign in to comment.