net-analyzer/mtr: backport 0.95-r1

This commit is contained in:
Alarig Le Lay 2023-08-08 14:26:58 +02:00
parent 3fc1646a01
commit 0c224c69b4
3 changed files with 55 additions and 15 deletions

View file

@ -1,2 +1 @@
DIST mtr-0.94.tar.gz 143616 BLAKE2B e9b4619a85a515d729f0987d5882fb91e4bfa3be82476efbfdb832d0b13ed334be1c1a1bcf8ab4ca820002e79ca4a24d0b50f2739d9284b7dec0b8852a1a91e0 SHA512 0e58bd79562ff80f9308135562ab22aa1f1eea686aefd3aef07bac05e661e34b60fde7c66c96bf4f0919f546376fbd6106ecd8fa92328c24f6f903097496bf11
DIST mtr-0.95.tar.gz 144541 BLAKE2B 3c972675b97945b96562802c5d0f10de963160682c93c0ea2991b72eca33d136d18948c5e746ca3dfb280ebc9c3ab154e7774f8409ed4e5f7470a8feb128e71b SHA512 a7d69e0c551a10ae80a650a34588119e6c6b124a8c2c93d3de29e5daa6ef99f9217d875529d443c3760cd6fd7bd04d1e9abe33ef12635826c66a98bd776c1690 DIST mtr-0.95.tar.gz 144541 BLAKE2B 3c972675b97945b96562802c5d0f10de963160682c93c0ea2991b72eca33d136d18948c5e746ca3dfb280ebc9c3ab154e7774f8409ed4e5f7470a8feb128e71b SHA512 a7d69e0c551a10ae80a650a34588119e6c6b124a8c2c93d3de29e5daa6ef99f9217d875529d443c3760cd6fd7bd04d1e9abe33ef12635826c66a98bd776c1690

View file

@ -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;

View file

@ -1,39 +1,46 @@
# Copyright 1999-2022 Gentoo Authors # Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=8
inherit autotools bash-completion-r1 fcaps inherit autotools bash-completion-r1 fcaps
DESCRIPTION="My TraceRoute, an Excellent network diagnostic tool" DESCRIPTION="My TraceRoute, an Excellent network diagnostic tool"
HOMEPAGE="https://www.bitwizard.nl/mtr/" HOMEPAGE="https://www.bitwizard.nl/mtr/"
SRC_URI="https://github.com/traviscross/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
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" LICENSE="GPL-2"
SLOT="0" SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
IUSE="gtk +ipinfo +ipv6 jansson ncurses" IUSE="gtk +ipinfo +ipv6 jansson ncurses"
# TODO: This is an inherited RESTRICT - figure out why!
RESTRICT="test"
RDEPEND=" RDEPEND="
gtk? ( gtk? (
dev-libs/glib:2 dev-libs/glib:2
x11-libs/gtk+:3 x11-libs/gtk+:3
) )
jansson? ( dev-libs/jansson ) jansson? ( dev-libs/jansson:= )
ncurses? ( sys-libs/ncurses:0= ) ncurses? ( sys-libs/ncurses:= )
"
DEPEND="
${RDEPEND}
"
BDEPEND="
virtual/pkgconfig
" "
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
DOCS=( AUTHORS FORMATS NEWS README.md SECURITY TODO ) DOCS=( AUTHORS FORMATS NEWS README.md SECURITY TODO )
FILECAPS=( cap_net_raw usr/sbin/mtr-packet ) FILECAPS=( cap_net_raw usr/sbin/mtr-packet )
PATCHES=( PATCHES=(
"${FILESDIR}/${PN}-0.88-tinfo.patch" "${FILESDIR}"/${PN}-0.88-tinfo.patch
"${FILESDIR}/${P}-ipv4-sockets.patch" "${FILESDIR}"/${P}-fortify-source-3.patch
"${FILESDIR}"/${PN}-0.94-ipv4-sockets.patch
) )
RESTRICT="test"
src_prepare() { src_prepare() {
default default