Accepting request 705287 from network:utilities

OBS-URL: https://build.opensuse.org/request/show/705287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/iputils?expand=0&rev=45
This commit is contained in:
Dominique Leuenberger 2019-05-28 07:41:27 +00:00 committed by Git OBS Bridge
commit 9131931e27
9 changed files with 239 additions and 118 deletions

View File

@ -0,0 +1,77 @@
From 3b013f271931c3fe771e5a2c591f35d617de90f3 Mon Sep 17 00:00:00 2001
From: Michael Weiss <dev.primeos@gmail.com>
Date: Thu, 16 May 2019 10:08:50 +0000
Subject: [PATCH] build-sys/doc: Fix the dependency on xsltproc
This dependency is only required if either the man pages or the HTML
documentation is being build. Both targets require docbook-xsl-ns and
not docbook-xsl (the former is preferred and in use since c503834).
---
.travis.yml | 1 -
doc/meson.build | 27 +++++++++++++++++----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 54edb61..6a6e8c3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,7 +14,6 @@ addons:
- "libidn2-0-dev"
- "nettle-dev"
- "xsltproc"
- - "docbook-xsl"
- "docbook-xsl-ns"
matrix:
include:
diff --git a/doc/meson.build b/doc/meson.build
index 369090f..9a007b3 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -38,7 +38,7 @@ if build_ninfod == true
manpages += ['ninfod']
endif
-xsltproc = find_program('xsltproc', required : true)
+xsltproc = find_program('xsltproc', required : build_mans or build_html_mans)
xsltproc_args = [
'--nonet',
'--stringparam', 'man.output.quietly', '1',
@@ -48,19 +48,26 @@ xsltproc_args = [
]
if xsltproc.found()
- xsl = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
- testrun = run_command([xsltproc, '--nonet', xsl])
- xsltproc_works = testrun.returncode() == 0
- if xsltproc_works == false
- warning('xsltproc: cannot process ' + xsl)
+ doc_targets = []
+ if build_mans
+ doc_targets += ['manpages']
endif
-else
- warning('No docbook stylesheet found for generating man pages')
- xsltproc_works = false
+ if build_html_mans
+ doc_targets += ['html']
+ endif
+ xsltproc_works = true
+ foreach doc_target : doc_targets
+ xsl = 'http://docbook.sourceforge.net/release/xsl-ns/current/' + doc_target + '/docbook.xsl'
+ testrun = run_command([xsltproc, '--nonet', xsl])
+ if testrun.returncode() != 0
+ xsltproc_works = false
+ warning('xsltproc: cannot process ' + xsl)
+ endif
+ endforeach
endif
if xsltproc_works == false
- error('Man pages cannot be built: xsltproc does not work correctly')
+ error('Docs cannot be built: xsltproc does not work correctly')
endif
if build_mans
--
2.21.0

View File

@ -1,41 +0,0 @@
From e0baf20067a75f093d690bd51a6db3f5afabca77 Mon Sep 17 00:00:00 2001
From: Petr Vorel <pvorel@suse.cz>
Date: Tue, 17 Jul 2018 17:56:10 +0200
Subject: [PATCH] tracepath: Fix copying input IPv6 address
Commit e669c86 broke copying input IPv6 address.
tracepath recover from it, but it's slower.
Previously was address too short:
strace ./tracepath -6 fe80::8895:e2af:e96e:fd8f
sendto(3, "\1\0\0\0\0\0\0\0\307\36N[\0\0\0\0w_\f\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 127952, 0, {sa_family=AF_INET6, sin6_port=htons(44444), inet_pton(AF_INET6, "fe80::", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EMSGSIZE (Message too long)
After fix is correct:
sendto(3, "\1\0\0\0\0\0\0\0\300\36N[\0\0\0\0'B\3\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 127952, 0, {sa_family=AF_INET6, sin6_port=htons(44444), inet_pton(AF_INET6, "fe80::8895:e2af:e96e:fd8f", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EMSGSIZE (Message too long)
Bug found by LTP test.
Fixes: e669c86 tracepath: fix heap-buffer-overflow [asan]
Fixes: #137
---
tracepath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tracepath.c b/tracepath.c
index 53bda16..539a7a1 100644
--- a/tracepath.c
+++ b/tracepath.c
@@ -475,7 +475,7 @@ int main(int argc, char **argv)
fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (fd < 0)
continue;
- memcpy(&target, ai->ai_addr, sizeof(*ai->ai_addr));
+ memcpy(&target, ai->ai_addr, ai->ai_addrlen);
targetlen = ai->ai_addrlen;
break;
}
--
2.18.0

View File

@ -8,19 +8,19 @@ Signed-off-by: Hannes Reinecke <hare@suse.de>
ping.c | 8 ++++++++
1 file changed, 8 insertions(+)
Index: iputils/ping.c
===================================================================
--- iputils.orig/ping.c
+++ iputils/ping.c
@@ -94,6 +94,7 @@ static unsigned short in_cksum(const unsigned short *addr, int len, unsigned sho
static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp);
diff --git a/ping.c b/ping.c
index 06cc369..2c76677 100644
--- a/ping.c
+++ b/ping.c
@@ -92,6 +92,7 @@ static unsigned short in_cksum(const unsigned short *addr, int len, unsigned sho
static void pr_icmph(uint8_t type, uint8_t code, uint32_t info, struct icmphdr *icp);
static int parsetos(char *str);
static int parseflow(char *str);
+static void doexit (int);
static struct {
struct cmsghdr cm;
@@ -572,6 +573,8 @@ int ping4_run(int argc, char **argv, struct addrinfo *ai, socket_st *sock)
static struct sockaddr_in source = { .sin_family = AF_INET };
char *device;
@@ -543,6 +544,8 @@ int ping4_run(int argc, char **argv, struct addrinfo *ai, socket_st *sock)
options |= F_SOURCEROUTE;
}
}
@ -29,12 +29,15 @@ Index: iputils/ping.c
while (argc > 0) {
target = *argv;
@@ -1711,3 +1714,8 @@ void usage(void)
ping6_usage(1);
exit(2);
@@ -1619,3 +1622,8 @@ void ping4_install_filter(socket_st *sock)
if (setsockopt(sock->fd, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter)))
error(0, errno, _("WARNING: failed to install socket filter"));
}
+
+static void doexit(int signo)
+static void doexit(int signo __attribute__((unused)))
+{
+ exit (1);
+}
--
2.21.0

View File

@ -16,10 +16,10 @@ Signed-off-by: Hannes Reinecke <hare@suse.de>
1 file changed, 11 insertions(+)
diff --git a/ping.c b/ping.c
index 733477f..4efdaa8 100644
index 3debd82..06cc369 100644
--- a/ping.c
+++ b/ping.c
@@ -483,6 +483,17 @@ main(int argc, char **argv)
@@ -452,6 +452,17 @@ main(int argc, char **argv)
/* Create sockets */
enable_capability_raw();
@ -35,8 +35,8 @@ index 733477f..4efdaa8 100644
+ set_signal(SIGALRM, doexit);
+
if (hints.ai_family != AF_INET6)
create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP, hints.ai_family == AF_INET);
if (hints.ai_family != AF_INET) {
create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP,
hints.ai_family == AF_INET);
--
2.17.1

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Fri May 24 16:22:41 UTC 2019 - Petr Vorel <pvorel@suse.cz>
- Update to version s20190515 (includes changes s20190324)
* s20190324: 189 commits since s20180629 that include changing build
system from autotools to meson, added rarpd and rdisc systemd service
files, many fixes
* s20190515 bugfix release (6 commits)
- User visible change: arping and clockdiff are moved from /usr/sbin
to /usr/bin (respect upstream path)
- Backport patch 0001-build-sys-doc-Fix-the-dependency-on-xsltproc.patch
(fixing build system)
- Add workaround patch meson-remove-setcap-setuid.sh.patch
- Remove 0001-tracepath-Fix-copying-input-IPv6-address.patch
(included in s20190324 release)
- Refresh old patches (iputils-ping-interrupt.diff, iputils-sec-ping-unblock.diff)
- Changes caused by upstream switching to meson build system (drop sed build dependency)
- Added locales
- Fix typos
-------------------------------------------------------------------
Thu Jul 26 09:17:45 UTC 2018 - pvorel@suse.cz

View File

@ -1,7 +1,7 @@
#
# spec file for package iputils
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -12,12 +12,12 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: iputils
Version: s20180629
Version: s20190515
Release: 0
Summary: IPv4 and IPv6 Networking Utilities
License: BSD-3-Clause AND GPL-2.0-or-later
@ -27,24 +27,26 @@ Source0: https://github.com/iputils/iputils/archive/%{version}.tar.gz
Source1: rarpd.service
Patch1: iputils-sec-ping-unblock.diff
Patch2: iputils-ping-interrupt.diff
Patch3: 0001-tracepath-Fix-copying-input-IPv6-address.patch
BuildRequires: docbook-xsl-stylesheets
BuildRequires: docbook_3
Patch3: 0001-build-sys-doc-Fix-the-dependency-on-xsltproc.patch
Patch4: meson-remove-setcap-setuid.sh.patch
BuildRequires: docbook5-xsl-stylesheets
BuildRequires: docbook_5
BuildRequires: iso_ent
BuildRequires: libcap-devel
BuildRequires: libidn2-devel
BuildRequires: libopenssl-devel
BuildRequires: meson
BuildRequires: opensp
BuildRequires: perl-SGMLS
BuildRequires: pkgconfig
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(systemd)
# For Makefile modifications
BuildRequires: sed
BuildRequires: pkgconfig(libidn)
Requires(pre): permissions
# I have spotted at least two packages (yast-printer and dhcp-client) that need
# /bin/ping and /sbin/arping but they do not seem to use them with absolute
# paths so we may be lukcy and no further changes are necessary.
# paths so we may be lucky and no further changes are necessary.
Provides: /bin/ping
Provides: /sbin/arping
@ -67,115 +69,116 @@ out their IP addresses.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
# Drop LASTTAG variable since it needs git and it's not used for regular
# building
sed -i '/^LASTTAG:=/d' Makefile
# Do not link against nettle
sed -i '/^USE_NETTLE/s/yes/no/' Makefile
# Export CFLAGS so we can also benefit from the ones the Makefile sets for us
# Instead of overriding all of them.
export CFLAGS='%{optflags} -fpie'
%ifarch s390 s390x
export CFLAGS="-fPIE"
%else
export CFLAGS="-fpie"
%endif
# Pulled-in by the LINK.o variable.
export LDFLAGS='-pie -Wl,-z,relro,-z,now'
export LDFLAGS="-pie -Wl,-z,relro,-z,now"
# Build only selected apps
make %{?_smp_mflags} arping clockdiff ping rdisc tracepath \
rarpd man
%meson -DBUILD_NINFOD=false -DBUILD_TFTPD=false -DBUILD_RARPD=true
%meson_build
%install
mkdir -p %{buildroot}/%{_sbindir}
mkdir -p %{buildroot}/%{_bindir}
install arping %{buildroot}/%{_sbindir}
install clockdiff %{buildroot}/%{_sbindir}
install rarpd %{buildroot}/%{_sbindir}
install rdisc %{buildroot}/%{_sbindir}
# boo#795788
install tracepath %{buildroot}/%{_bindir}
install ping %{buildroot}/%{_bindir}
%meson_install
# boo#1017616
ln -sf %{_bindir}/ping %{buildroot}/%{_bindir}/ping6
ln -sf %{_bindir}/tracepath %{buildroot}/%{_bindir}/tracepath6
# symlink to man tracepath6(8)
ln -sf %{_mandir}/man8/tracepath.8%{ext_man} %{buildroot}%{_mandir}/man8/tracepath6.8%{ext_man}
# Install service files and create rc compat symling
install -Dpm 0644 build/rdisc.service %{buildroot}/%{_unitdir}
install -Dpm 0644 build/rarpd@.service %{buildroot}/%{_unitdir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcrarpd
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcrdisc
#UsrMerge
# We still have reverse dependencies using /sbin/* or /bin/*
# so keep these symlinks for now. They are slowly being fixed
# but lets not just break them yet.
mkdir -p %{buildroot}/{bin,sbin}
ln -sf %{_sbindir}/arping %{buildroot}/sbin
ln -sf %{_sbindir}/clockdiff %{buildroot}/sbin
ln -sf %{_bindir}/arping %{buildroot}/bin
ln -sf %{_bindir}/clockdiff %{buildroot}/bin
ln -sf %{_sbindir}/rarpd %{buildroot}/sbin
ln -sf %{_sbindir}/rdisc %{buildroot}/sbin
ln -sf %{_bindir}/tracepath %{buildroot}/bin
ln -sf %{_bindir}/ping %{buildroot}/bin
ln -sf %{_bindir}/ping6 %{buildroot}/bin
ln -sf %{_bindir}/tracepath %{buildroot}/bin
ln -sf %{_bindir}/tracepath6 %{buildroot}/bin
#EndUsrMerge
mkdir -p %{buildroot}/%{_mandir}/man8
# Remove conflicting / unused manpages
rm doc/ninfod* doc/pg3* doc/rdisc* doc/tftpd* doc/traceroute* doc/ipg* doc/pgset*
# Install the rest
install -m 644 doc/*.8 %{buildroot}%{_mandir}/man8/
%find_lang %{name}
# Install rarp service and create rc compat symling
install -Dpm 0644 %{SOURCE1} %{buildroot}/%{_unitdir}/rarpd.service
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcrarpd
%pre
%service_add_pre rdisc.service
%post
%set_permissions %{_bindir}/ping
%verifyscript
%verify_permissions -e %{_bindir}/ping
%service_add_post rdisc.service
%preun
%service_del_preun rdisc.service
%postun
%service_del_postun rdisc.service
%pre -n rarpd
%service_add_pre rarpd.service
%service_add_pre rarpd@.service
%post -n rarpd
%service_add_post rarpd.service
%service_add_post rarpd@.service
%preun -n rarpd
%service_del_preun rarpd.service
%service_del_preun rarpd@.service
%postun -n rarpd
%service_del_postun rarpd.service
%service_del_postun rarpd@.service
%files
%if 0%{?suse_version} < 1500
%doc LICENSE LICENSE.BSD3 LICENSE.GPL2
%else
%license LICENSE LICENSE.BSD3 LICENSE.GPL2
%endif
%files -f %{name}.lang
%license LICENSE
%verify(not mode caps) %attr(0755,root,root) %{_bindir}/ping
%{_bindir}/arping
%{_bindir}/clockdiff
%{_bindir}/ping6
%{_sbindir}/arping
%{_sbindir}/clockdiff
%{_sbindir}/rcrdisc
%{_sbindir}/rdisc
%{_bindir}/tracepath
%{_bindir}/tracepath6
%{_sbindir}/rdisc
%{_unitdir}/rdisc.service
#UsrMerge
/bin/arping
/bin/clockdiff
/bin/ping
/bin/ping6
/sbin/rdisc
/bin/tracepath
/bin/tracepath6
/sbin/arping
/sbin/clockdiff
/sbin/rdisc
#EndUsrMerge
%{_mandir}/man8/arping.8%{ext_man}
%{_mandir}/man8/clockdiff.8%{ext_man}
%{_mandir}/man8/ping.8%{ext_man}
%{_mandir}/man8/rdisc.8%{ext_man}
%{_mandir}/man8/tracepath.8%{ext_man}
%{_mandir}/man8/tracepath6.8%{ext_man}
#EndUsrMerge
%files -n rarpd
%{_sbindir}/rarpd
%{_unitdir}/rarpd@.service
%{_sbindir}/rcrarpd
%{_unitdir}/rarpd.service
#UsrMerge
/sbin/rarpd
#EndUsrMerge

View File

@ -0,0 +1,59 @@
# patch to workaround error
# meson.build:242:7: ERROR: add_install_script args must be strings
# Upstream status: not upstreamable (workaround)
diff --git a/meson.build b/meson.build
index 8af9e18..c82597c 100644
--- a/meson.build
+++ b/meson.build
@@ -239,12 +239,6 @@ if build_ping == true
dependencies : [m_dep, cap_dep, idn_dep, crypto_dep, resolv_dep],
link_with : [libcommon],
install: true)
- meson.add_install_script('build-aux/setcap-setuid.sh',
- join_paths(get_option('prefix'), get_option('bindir')),
- 'ping',
- perm_type,
- setcap.path()
- )
endif
if build_tracepath == true
@@ -259,12 +253,6 @@ if build_traceroute6 == true
dependencies : [cap_dep, idn_dep],
link_with : [libcommon],
install: true)
- meson.add_install_script('build-aux/setcap-setuid.sh',
- join_paths(get_option('prefix'), get_option('bindir')),
- 'traceroute6',
- perm_type,
- setcap.path()
- )
endif
if build_clockdiff == true
@@ -272,12 +260,6 @@ if build_clockdiff == true
dependencies : [cap_dep],
link_with : [libcommon],
install: true)
- meson.add_install_script('build-aux/setcap-setuid.sh',
- join_paths(get_option('prefix'), get_option('bindir')),
- 'clockdiff',
- perm_type,
- setcap.path()
- )
endif
if build_rinfod == true
@@ -302,12 +284,6 @@ if build_arping == true
dependencies : [rt_dep, cap_dep, idn_dep],
link_with : [libcommon],
install: true)
- meson.add_install_script('build-aux/setcap-setuid.sh',
- join_paths(get_option('prefix'), get_option('bindir')),
- 'arping',
- perm_type,
- setcap.path()
- )
endif
if build_tftpd == true

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:da14105291dd491f28ea91ade854ed10aee8ba019641c80eed233de3908be7c5
size 195094

3
s20190515.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9b5125eb5ef9f4e947ad8fdddcf77f538f53b8f47b53eb5bc5347cb16d01c8fd
size 403228