summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-07-28 14:41:50 +0100
committerSam James <sam@gentoo.org>2023-07-28 14:41:50 +0100
commita951a89289d8b3d8129f02141e38f5413a55902f (patch)
tree6269223d3a5b1363d9bed9cb2e2277df5f0c7fde /net-analyzer
parentmedia-gfx/graphicsmagick: fix build w/ libjpeg-turbo-3 (diff)
downloadgentoo-a951a89289d8b3d8129f02141e38f5413a55902f.tar.gz
gentoo-a951a89289d8b3d8129f02141e38f5413a55902f.tar.bz2
gentoo-a951a89289d8b3d8129f02141e38f5413a55902f.zip
net-analyzer/mtr: backport F_S=3 fix
Closes: https://bugs.gentoo.org/911389 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/mtr/files/mtr-0.95-fortify-source-3.patch34
-rw-r--r--net-analyzer/mtr/mtr-0.95-r1.ebuild68
-rw-r--r--net-analyzer/mtr/mtr-9999.ebuild9
3 files changed, 107 insertions, 4 deletions
diff --git a/net-analyzer/mtr/files/mtr-0.95-fortify-source-3.patch b/net-analyzer/mtr/files/mtr-0.95-fortify-source-3.patch
new file mode 100644
index 000000000000..0c3d593915e4
--- /dev/null
+++ b/net-analyzer/mtr/files/mtr-0.95-fortify-source-3.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/911389
+https://github.com/traviscross/mtr/pull/468
+https://github.com/traviscross/mtr/commit/a1548b40c0dcf6dd44c5e6906f829e249428436b
+
+From 5908af4c19188cb17b62f23368b6ef462831a0cb Mon Sep 17 00:00:00 2001
+From: Marcus Meissner <meissner@suse.de>
+Date: Tue, 11 Apr 2023 16:05:36 +0200
+Subject: [PATCH] fixed the sizes passed into snprintf
+
+--- a/ui/report.c
++++ b/ui/report.c
+@@ -140,7 +140,7 @@ void report_close(
+ continue;
+
+ snprintf(fmt, sizeof(fmt), "%%%ds", data_fields[j].length);
+- snprintf(buf + len, sizeof(buf), fmt, data_fields[j].title);
++ snprintf(buf + len, sizeof(buf) - len, fmt, data_fields[j].title);
+ len += data_fields[j].length;
+ }
+ printf("%s\n", buf);
+@@ -172,10 +172,10 @@ void report_close(
+
+ /* 1000.0 is a temporary hack for stats usec to ms, impacted net_loss. */
+ if (strchr(data_fields[j].format, 'f')) {
+- snprintf(buf + len, sizeof(buf), data_fields[j].format,
++ snprintf(buf + len, sizeof(buf) - len, data_fields[j].format,
+ data_fields[j].net_xxx(at) / 1000.0);
+ } else {
+- snprintf(buf + len, sizeof(buf), data_fields[j].format,
++ snprintf(buf + len, sizeof(buf) - len, data_fields[j].format,
+ data_fields[j].net_xxx(at));
+ }
+ len += data_fields[j].length;
+
diff --git a/net-analyzer/mtr/mtr-0.95-r1.ebuild b/net-analyzer/mtr/mtr-0.95-r1.ebuild
new file mode 100644
index 000000000000..a2c2010db273
--- /dev/null
+++ b/net-analyzer/mtr/mtr-0.95-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools bash-completion-r1 fcaps
+
+DESCRIPTION="My TraceRoute, an Excellent network diagnostic tool"
+HOMEPAGE="https://www.bitwizard.nl/mtr/"
+
+if [[ ${PV} == *9999* ]] ; then
+ EGIT_REPO_URI="https://github.com/traviscross/mtr"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/traviscross/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="gtk +ipinfo +ipv6 jansson ncurses"
+# TODO: This is an inherited RESTRICT - figure out why!
+RESTRICT="test"
+
+RDEPEND="
+ gtk? (
+ dev-libs/glib:2
+ x11-libs/gtk+:3
+ )
+ jansson? ( dev-libs/jansson:= )
+ ncurses? ( sys-libs/ncurses:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+DOCS=( AUTHORS FORMATS NEWS README.md SECURITY TODO )
+FILECAPS=( cap_net_raw usr/sbin/mtr-packet )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.88-tinfo.patch
+ "${FILESDIR}"/${P}-fortify-source-3.patch
+)
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable ipv6) \
+ $(use_with gtk) \
+ $(use_with ipinfo) \
+ $(use_with jansson) \
+ $(use_with ncurses) \
+ --with-bashcompletiondir="$(get_bashcompdir)"
+}
+
+pkg_postinst() {
+ fcaps_pkg_postinst
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "mtr needs root privileges to run. To grant them:"
+ ewarn " % sudo chown root ${EPREFIX}/usr/sbin/mtr"
+ ewarn " % sudo chmod u+s ${EPREFIX}/usr/sbin/mtr"
+ fi
+}
diff --git a/net-analyzer/mtr/mtr-9999.ebuild b/net-analyzer/mtr/mtr-9999.ebuild
index 42b6aeb30b04..a2c2010db273 100644
--- a/net-analyzer/mtr/mtr-9999.ebuild
+++ b/net-analyzer/mtr/mtr-9999.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit autotools bash-completion-r1 fcaps
@@ -13,7 +13,7 @@ if [[ ${PV} == *9999* ]] ; then
inherit git-r3
else
SRC_URI="https://github.com/traviscross/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
fi
LICENSE="GPL-2"
@@ -28,7 +28,7 @@ RDEPEND="
x11-libs/gtk+:3
)
jansson? ( dev-libs/jansson:= )
- ncurses? ( sys-libs/ncurses:0= )
+ ncurses? ( sys-libs/ncurses:= )
"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
@@ -38,6 +38,7 @@ FILECAPS=( cap_net_raw usr/sbin/mtr-packet )
PATCHES=(
"${FILESDIR}"/${PN}-0.88-tinfo.patch
+ "${FILESDIR}"/${P}-fortify-source-3.patch
)
src_prepare() {