From 3cc38a1180eab38bc7749c2746b96de1b4301e08 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 15:55:00 +0000 Subject: [PATCH] import UBI mtr-0.95-11.el10 --- .gitignore | 3 +- 0001-Prevent-icmp_socket-leak-on-error.patch | 32 +++++ ...et-filecaps-nor-setuid-manually-and-.patch | 28 ---- EMPTY | 1 - gating.yaml | 9 -- mtr-0.95-snprintf-sizes.patch | 35 +++++ mtr-gtk-pkexec-wrapper.sh | 10 -- mtr.spec | 121 ++++++++++++------ net-xmtr.desktop | 2 +- org.fedoraproject.mtr.policy | 17 --- sources | 2 +- 11 files changed, 154 insertions(+), 106 deletions(-) create mode 100644 0001-Prevent-icmp_socket-leak-on-error.patch delete mode 100644 0001-buildsys-don-t-set-filecaps-nor-setuid-manually-and-.patch delete mode 100644 EMPTY delete mode 100644 gating.yaml create mode 100644 mtr-0.95-snprintf-sizes.patch delete mode 100644 mtr-gtk-pkexec-wrapper.sh delete mode 100644 org.fedoraproject.mtr.policy diff --git a/.gitignore b/.gitignore index 6e4ec58..8806711 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/mtr-0.92.tar.gz -/mtr-0.92.tar.gz +mtr-0.95.tar.gz diff --git a/0001-Prevent-icmp_socket-leak-on-error.patch b/0001-Prevent-icmp_socket-leak-on-error.patch new file mode 100644 index 0000000..1e812a5 --- /dev/null +++ b/0001-Prevent-icmp_socket-leak-on-error.patch @@ -0,0 +1,32 @@ +From 7b4eda3369d937763f7076ad1098916a5973bc6a Mon Sep 17 00:00:00 2001 +From: Michal Sekletar +Date: Tue, 27 Aug 2024 17:59:15 +0200 +Subject: [PATCH] Prevent icmp_socket leak on error + +--- + packet/probe_unix.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/packet/probe_unix.c b/packet/probe_unix.c +index 00ec7a2..7362d6d 100644 +--- a/packet/probe_unix.c ++++ b/packet/probe_unix.c +@@ -296,6 +296,7 @@ int open_ip4_sockets_dgram( + } + #ifdef HAVE_LINUX_ERRQUEUE_H + if (setsockopt(icmp_socket, SOL_IP, IP_RECVERR, &val, sizeof(val)) < 0) { ++ close(icmp_socket); + return -1; + } + #endif +@@ -386,6 +387,7 @@ int open_ip6_sockets_dgram( + } + #ifdef HAVE_LINUX_ERRQUEUE_H + if (setsockopt(icmp_socket, SOL_IPV6, IPV6_RECVERR, &val, sizeof(val)) < 0) { ++ close(icmp_socket); + return -1; + } + #endif +-- +2.39.3 (Apple Git-146) + diff --git a/0001-buildsys-don-t-set-filecaps-nor-setuid-manually-and-.patch b/0001-buildsys-don-t-set-filecaps-nor-setuid-manually-and-.patch deleted file mode 100644 index fd3eab7..0000000 --- a/0001-buildsys-don-t-set-filecaps-nor-setuid-manually-and-.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 9d2800441a73a1dfb84f1c97a1e2755b9cac163c Mon Sep 17 00:00:00 2001 -From: Michal Sekletar -Date: Fri, 26 Jul 2019 01:56:10 +0200 -Subject: [PATCH] buildsys: don't set filecaps nor setuid manually and let - rpmbuild handle it - ---- - Makefile.am | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index c0709ca..daebb84 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -40,10 +40,6 @@ $(PATHFILES): Makefile - dist_man_MANS = mtr.8 mtr-packet.8 - PATHFILES += man/mtr.8 man/mtr-packet.8 - --install-exec-hook: -- `setcap cap_net_raw+ep $(DESTDIR)$(sbindir)/mtr-packet` \ -- || chmod u+s $(DESTDIR)$(sbindir)/mtr-packet -- - mtr_SOURCES = ui/mtr.c ui/mtr.h \ - ui/net.c ui/net.h \ - ui/cmdpipe.c ui/cmdpipe.h \ --- -2.21.0 - diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/gating.yaml b/gating.yaml deleted file mode 100644 index b6168c7..0000000 --- a/gating.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- !Policy - -product_versions: - - rhel-8 - -decision_context: osci_compose_gate - -rules: - - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/mtr-0.95-snprintf-sizes.patch b/mtr-0.95-snprintf-sizes.patch new file mode 100644 index 0000000..36c6d7d --- /dev/null +++ b/mtr-0.95-snprintf-sizes.patch @@ -0,0 +1,35 @@ +From 5908af4c19188cb17b62f23368b6ef462831a0cb Mon Sep 17 00:00:00 2001 +From: Marcus Meissner +Date: Tue, 11 Apr 2023 16:05:36 +0200 +Subject: [PATCH] fixed the sizes passed into snprintf + +--- + ui/report.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ui/report.c b/ui/report.c +index 9301480..61f2c74 100644 +--- 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/mtr-gtk-pkexec-wrapper.sh b/mtr-gtk-pkexec-wrapper.sh deleted file mode 100644 index b40c3e1..0000000 --- a/mtr-gtk-pkexec-wrapper.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -error_message="You are trying to run mtr-gtk in a Wayland session, however mtr-gtk requires root privileges and such graphical applications are not allowed to run on Wayland by default.\n\nSee https://fedoraproject.org/wiki/Common_F25_bugs\#wayland-root-apps for more details and possible workarounds.\n" - -if [ "$XDG_SESSION_TYPE" = wayland ]; then - zenity --error --title "mtr-gtk on Wayland" --text "$error_message" --width=600 2>/dev/null || printf "$error_message" >&2 - exit 1 -fi - -/usr/bin/pkexec /usr/bin/xmtr.bin diff --git a/mtr.spec b/mtr.spec index 0bd7819..f6344c8 100644 --- a/mtr.spec +++ b/mtr.spec @@ -2,20 +2,18 @@ Summary: Network diagnostic tool combining 'traceroute' and 'ping' Name: mtr -Version: 0.92 -Release: 3%{?dist} +Version: 0.95 +Release: 11%{?dist} Epoch: 2 -Group: Applications/Internet -License: GPLv2 +License: GPL-2.0-only URL: https://www.bitwizard.nl/mtr/ Source0: https://github.com/traviscross/mtr/archive/v%{version}/%{name}-%{version}.tar.gz Source1: net-x%{name}.desktop -Source2: mtr-gtk-pkexec-wrapper.sh -Source3: org.fedoraproject.mtr.policy +# https://github.com/traviscross/mtr/issues/469 +Patch0: https://github.com/traviscross/mtr/commit/5908af4c19188cb17b62f23368b6ef462831a0cb.patch#/mtr-0.95-snprintf-sizes.patch +Patch1: 0001-Prevent-icmp_socket-leak-on-error.patch -Patch0001: 0001-buildsys-don-t-set-filecaps-nor-setuid-manually-and-.patch - -BuildRequires: ncurses-devel gtk2-devel desktop-file-utils +BuildRequires: gcc make ncurses-devel libcap-devel jansson-devel BuildRequires: autoconf automake libtool git %description @@ -30,18 +28,18 @@ the link to each machine. While doing this, it prints running statistics about each machine. MTR provides two user interfaces: an ncurses interface, useful for the -command line, e.g. for SSH sessions; and a GTK+ interface for X (provided +command line, e.g. for SSH sessions; and a GTK interface for X (provided in the mtr-gtk package). %package gtk -Summary: GTK+ interface for MTR -Group: Applications/Internet +Summary: GTK interface for MTR Requires: %{name} = %{epoch}:%{version}-%{release} +BuildRequires: gtk3-devel desktop-file-utils %description gtk MTR combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool. The mtr-gtk package provides the -GTK+ interface for MTR. +GTK interface for MTR. When MTR is started, it investigates the network connection between the host MTR runs on and the user-specified destination host. Afterwards it @@ -51,55 +49,104 @@ the link to each machine. While doing this, it prints running statistics about each machine. %prep -%autosetup -S git +%setup -q +%patch0 -p1 -b .snprintf-sizes +%patch -P1 -p1 -b .socket-leak %build -autoreconf -vfi -export CFLAGS="%{optflags} -fPIE" -export LDFLAGS="-z now -pie" - -# Upstream forgot to ship .tarball-version -echo "%{version}" > .tarball-version - ./bootstrap.sh %configure --with-gtk -%make_build && mv -f mtr xmtr.bin && make distclean +%make_build && mv -f mtr xmtr && make distclean %configure --without-gtk %make_build %install -install -D -p -m 0755 mtr %{buildroot}%{_sbindir}/mtr -install -D -p -m 0755 xmtr.bin %{buildroot}%{_bindir}/xmtr.bin -install -D -p -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/xmtr -install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/polkit-1/actions/org.fedoraproject.mtr.policy -install -D -p -m 0644 img/mtr_icon.xpm %{buildroot}%{_datadir}/pixmaps/mtr_icon.xpm %make_install +install -D -p -m 0755 xmtr %{buildroot}%{_bindir}/xmtr +install -D -p -m 0644 img/mtr_icon.xpm %{buildroot}%{_datadir}/pixmaps/mtr_icon.xpm desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} %files -%{!?_licensedir:%global license %%doc} %license COPYING -%doc AUTHORS FORMATS NEWS README SECURITY +%doc AUTHORS FORMATS NEWS README.md SECURITY %{_sbindir}/%{name} -%caps(cap_net_raw=pe) %{_sbindir}/%{name}-packet -%{_mandir}/man8/* +%attr(0755,root,root) %caps(cap_net_raw=pe) %{_sbindir}/%{name}-packet +%{_mandir}/man8/%{name}.8* +%{_mandir}/man8/%{name}-packet.8* %dir %{_datadir}/bash-completion/ %dir %{_datadir}/bash-completion/completions/ %{_datadir}/bash-completion/completions/%{name} %files gtk %{_bindir}/xmtr -%{_bindir}/xmtr.bin %{_datadir}/pixmaps/mtr_icon.xpm -%{_datadir}/polkit-1/actions/org.fedoraproject.mtr.policy %{_datadir}/applications/net-x%{name}.desktop %changelog -* Mon Jul 29 2019 Michal Sekletar - 2:0.92-3 -- fix name of the gating config file (#1681042) +* Fri Feb 14 2025 Michal Sekletar - 2:0.95-11 +- fix SAST issues (RHEL-40015) -* Fri Jul 26 2019 Michal Sekletar - 2:0.92-2 -- don't set setuid and filecaps manually (#1633182) +* Tue Oct 29 2024 Troy Dawson - 2:0.95-10 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Mon Jun 24 2024 Troy Dawson - 2:0.95-9 +- Bump release for June 2024 mass rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 2:0.95-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 2:0.95-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Fedora Release Engineering - 2:0.95-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Apr 21 2023 Robert Scheck - 2:0.95-5 +- Added upstream patch to fix segmentation fault for '-r' (#2188394) + +* Thu Jan 19 2023 Fedora Release Engineering - 2:0.95-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 2:0.95-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 2:0.95-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jan 13 2022 Robert Scheck - 2:0.95-1 +- Rebase to 0.95 (#2039260) + +* Thu Jul 22 2021 Fedora Release Engineering - 2:0.94-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Sat Apr 10 2021 Robert Scheck - 2:0.94-3 +- Add upstream patches to fix various xmtr issues (#1488417) + +* Tue Jan 26 2021 Fedora Release Engineering - 2:0.94-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sun Jan 24 2021 Robert Scheck - 2:0.94-1 +- Rebase to 0.94 (#1742473, #1840079) +- Drop policykit wrapper for xmtr due to libcap (#1488417, #1488418) + +* Tue Jul 28 2020 Fedora Release Engineering - 2:0.92-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 2:0.92-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 2:0.92-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 2:0.92-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 2:0.92-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Feb 08 2018 Fedora Release Engineering - 2:0.92-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Sat Aug 26 2017 Robert Scheck - 2:0.92-1 - Rebase to 0.92 (#1458265) diff --git a/net-xmtr.desktop b/net-xmtr.desktop index a5570fa..69d1fc4 100644 --- a/net-xmtr.desktop +++ b/net-xmtr.desktop @@ -4,7 +4,7 @@ Type=Application Comment=Traces packets between two network hosts Exec=xmtr Terminal=false -Icon=mtr_icon.xpm +Icon=mtr_icon Encoding=UTF-8 X-Desktop-File-Install-Version=0.2 Categories=System;Application; diff --git a/org.fedoraproject.mtr.policy b/org.fedoraproject.mtr.policy deleted file mode 100644 index f9e68b4..0000000 --- a/org.fedoraproject.mtr.policy +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Run mtr - Authentication is required to run traceroute - - no - no - auth_admin_keep - - /usr/bin/xmtr.bin - true - - diff --git a/sources b/sources index 7f2f4f4..d817615 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mtr-0.92.tar.gz) = 576da5717f0abf849f5583bdd09790fb14a3b7538289192ac0d41bfa2a1c8e5bc9ec11bff87c5b348e85b5fe6f70f046d1d897e506e597b6f00d56bc918c0450 +SHA512 (mtr-0.95.tar.gz) = a7d69e0c551a10ae80a650a34588119e6c6b124a8c2c93d3de29e5daa6ef99f9217d875529d443c3760cd6fd7bd04d1e9abe33ef12635826c66a98bd776c1690