summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMats Erik Andersson <mats.andersson@gisladisker.se>2011-05-20 20:59:17 +0200
committerGuillem Jover <guillem@hadrons.org>2011-11-05 05:10:04 +0100
commit2cc9ec7f68d4742acdce762aeaa8b915de10adef (patch)
treea120802895add41dd6df0501ab6868e8c4413af7
parent437543b5c7b66b4954c917fa4af4245c297295f9 (diff)
downloadinetutils-2cc9ec7f68d4742acdce762aeaa8b915de10adef.tar.gz
Add inetutils-traceroute package
This provides a portable traceroute implementation for GNU/Hurd and GNU/kFreeBSD. Closes: #610437
-rw-r--r--debian/changelog3
-rw-r--r--debian/control.in12
-rw-r--r--debian/inetutils-traceroute.install1
-rw-r--r--debian/inetutils-traceroute.lintian-overrides1
-rw-r--r--debian/inetutils-traceroute.manpages1
-rw-r--r--debian/inetutils-traceroute.postinst10
-rw-r--r--debian/inetutils-traceroute.prerm12
-rw-r--r--debian/patches/72_traceroute_fix_setsockopt.patch64
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules6
10 files changed, 109 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 4545a30..daf0c35 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ inetutils (2:1.8-5) UNRELEASED; urgency=low
* Move man pages from patches to actual files under debian/local/man/ to
ease their modification, given that upstream has rejected including
useful man pages there.
+ * Add a new inetutils-traceroute package providing a portable traceroute
+ implementation for GNU/Hurd and GNU/kFreeBSD. (Closes: #610437)
+ Thanks to Mats Erik Andersson <mats.andersson@gisladisker.se>.
-- Guillem Jover <guillem@debian.org> Sat, 05 Nov 2011 00:28:58 +0100
diff --git a/debian/control.in b/debian/control.in
index 54b418c..1a8ea3a 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -51,6 +51,18 @@ Description: ICMP echo tool
Ping uses ICMP to send out echo requests, and uses the reply packets to
calculate latency between the sending and the destination hosts.
+Package: inetutils-traceroute
+Priority: @inetutils:Priority@
+Architecture: any
+Provides: traceroute
+Depends: ${shlibs:Depends}, ${misc:Depends}, netbase
+Description: trace the IPv4 route to another host
+ The traceroute utility displays the route taken by IP packets on their
+ way to another host or another network.
+ .
+ Install this package if you need a tool to examine network connectivity
+ or to diagnose network problems.
+
Package: inetutils-syslogd
Priority: @syslogd:Priority@
Architecture: any
diff --git a/debian/inetutils-traceroute.install b/debian/inetutils-traceroute.install
new file mode 100644
index 0000000..a139afa
--- /dev/null
+++ b/debian/inetutils-traceroute.install
@@ -0,0 +1 @@
+usr/bin/inetutils-traceroute
diff --git a/debian/inetutils-traceroute.lintian-overrides b/debian/inetutils-traceroute.lintian-overrides
new file mode 100644
index 0000000..9199b2c
--- /dev/null
+++ b/debian/inetutils-traceroute.lintian-overrides
@@ -0,0 +1 @@
+inetutils-traceroute: setuid-binary usr/bin/inetutils-traceroute 4755 root/root
diff --git a/debian/inetutils-traceroute.manpages b/debian/inetutils-traceroute.manpages
new file mode 100644
index 0000000..dc065e1
--- /dev/null
+++ b/debian/inetutils-traceroute.manpages
@@ -0,0 +1 @@
+debian/tmp/usr/share/man/man1/inetutils-traceroute.1
diff --git a/debian/inetutils-traceroute.postinst b/debian/inetutils-traceroute.postinst
new file mode 100644
index 0000000..ee6fc43
--- /dev/null
+++ b/debian/inetutils-traceroute.postinst
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+update-alternatives --install /usr/bin/traceroute traceroute \
+ /usr/bin/inetutils-traceroute 100 \
+ --slave /usr/share/man/man1/traceroute.1.gz traceroute.1.gz \
+ /usr/share/man/man1/inetutils-traceroute.1.gz
+
+#DEBHELPER#
diff --git a/debian/inetutils-traceroute.prerm b/debian/inetutils-traceroute.prerm
new file mode 100644
index 0000000..74e5367
--- /dev/null
+++ b/debian/inetutils-traceroute.prerm
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ remove|deconfigure)
+ update-alternatives --remove traceroute /usr/bin/inetutils-traceroute
+ ;;
+ *)
+esac
+
+#DEBHELPER#
diff --git a/debian/patches/72_traceroute_fix_setsockopt.patch b/debian/patches/72_traceroute_fix_setsockopt.patch
new file mode 100644
index 0000000..2f86a89
--- /dev/null
+++ b/debian/patches/72_traceroute_fix_setsockopt.patch
@@ -0,0 +1,64 @@
+Description: Use integer arguments to setsockopt().
+ GNU/kFreeBSD must pass an integer argument with IP_TTL
+ in setsockopt(2). Thsi has no ill effect with GNU/Linux.
+ .
+ The change is backported from upstream git repository.
+Author: Mats Erik Andersson <debian@gisladisker.se>
+Forwarded: not-needed
+Last-Update: 2011-01-18
+
+--- inetutils-1.8/src/traceroute.c.orig
++++ inetutils-1.8/src/traceroute.c
+@@ -67,7 +67,7 @@
+ int icmpfd, udpfd;
+ enum trace_type type;
+ struct sockaddr_in to, from;
+- unsigned char ttl;
++ int ttl;
+ struct timeval tsent;
+ } trace_t;
+
+@@ -314,7 +314,7 @@
+ trace_init (trace_t * t, const struct sockaddr_in to,
+ const enum trace_type type)
+ {
+- const unsigned char *ttlp;
++ const int *ttlp;
+ assert (t);
+ ttlp = &t->ttl;
+
+@@ -329,7 +329,7 @@
+ error (EXIT_FAILURE, errno, "socket");
+
+ if (setsockopt (t->udpfd, IPPROTO_IP, IP_TTL, ttlp,
+- sizeof (t->ttl)) < 0)
++ sizeof (*ttlp)) < 0)
+ error (EXIT_FAILURE, errno, "setsockopt");
+ }
+
+@@ -343,7 +343,7 @@
+ error (EXIT_FAILURE, errno, "socket");
+
+ if (setsockopt (t->icmpfd, IPPROTO_IP, IP_TTL,
+- ttlp, sizeof (t->ttl)) < 0)
++ ttlp, sizeof (*ttlp)) < 0)
+ error (EXIT_FAILURE, errno, "setsockopt");
+ }
+ else
+@@ -523,14 +523,14 @@
+ trace_inc_ttl (trace_t * t)
+ {
+ int fd;
+- const unsigned char *ttlp;
++ const int *ttlp;
+
+ assert (t);
+
+ ttlp = &t->ttl;
+ t->ttl++;
+ fd = (t->type == TRACE_UDP ? t->udpfd : t->icmpfd);
+- if (setsockopt (fd, IPPROTO_IP, IP_TTL, ttlp, sizeof (t->ttl)) < 0)
++ if (setsockopt (fd, IPPROTO_IP, IP_TTL, ttlp, sizeof (*ttlp)) < 0)
+ error (EXIT_FAILURE, errno, "setsockopt");
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index 607f159..6584c3c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
63_inetd_ipv6_sockaddrlen.patch
64_telnetd_ipv6_sockaddrlen.patch
70_ftbfs_non-linux.patch
+72_traceroute_fix_setsockopt.patch
diff --git a/debian/rules b/debian/rules
index e69033d..4b067cf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -126,6 +126,8 @@ install: build
cp $(M)/ftp.1 $(D)/$(man1dir)/inetutils-ftp.1
mv $(D)/usr/bin/talk $(D)/usr/bin/inetutils-talk
cp $(M)/talk.1 $(D)/$(man1dir)/inetutils-talk.1
+ mv $(D)/usr/bin/traceroute $(D)/usr/bin/inetutils-traceroute
+ cp man/traceroute.1 $(D)/$(man1dir)/inetutils-traceroute.1
binary-indep:
# Nothing to do.
@@ -154,8 +156,8 @@ binary-arch: install
dh_link -a
dh_strip -a
dh_compress -a
- # pings are setuid
- dh_fixperms -a -Xbin/ping -Xbin/ping6
+ # pings and traceroute are setuid
+ dh_fixperms -a -Xbin/ping -Xbin/ping6 -Xusr/bin/inetutils-traceroute
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a -- \