diff -Nru bsd-finger-0.17/debian/changelog bsd-finger-0.17/debian/changelog --- bsd-finger-0.17/debian/changelog 2010-02-12 05:18:06.000000000 +0000 +++ bsd-finger-0.17/debian/changelog 2012-06-18 05:40:00.000000000 +0000 @@ -1,17 +1,33 @@ +bsd-finger (0.17-15) unstable; urgency=low + + * Fix "finger client causes long timeouts" + Add 06-572211-decrease-timeout.patch + Patch by Mats Erik Andersson + Closes: #572211 + * Suggests: finger + Closes: #622105 + * Enable hardened build flags + * DH compatibility level is 9 + * Standards version is 3.9.3 + * Debian source format is 3.0 (quilt) + * Fix debian-rules-missing-recommended-target + + -- Anibal Monsalve Salazar Mon, 18 Jun 2012 15:37:11 +1000 + bsd-finger (0.17-14) unstable; urgency=low [ Mats Erik Andersson ] * Implement IPv6-support Add 03-468454-fingerd-ipv6.patch Add 04-468454-finger-ipv6.patch - Closes: 468454 + Closes: #468454 * debian/fingerd.examples: Add debian/local/finger.xinetd [ Anibal Monsalve Salazar ] * Don't segfault when /etc/passwd has netgroup entry Add 05-547014-netgroup.patch Patch by Matthew A. Dunford - Closes: 547014 + Closes: #547014 * Debian source format is 3.0 (quilt) * Fix out-of-date-standards-version * Fix maintainer-script-without-set-e @@ -27,7 +43,7 @@ * Run dh_prep instead of dh_clean -k * Work with a non-iterable nsswitch source 02-518559-nsswitch-sources.patch by Tim Abbott - closes: 518559 + closes: #518559 -- Anibal Monsalve Salazar Wed, 10 Jun 2009 19:49:18 +1000 diff -Nru bsd-finger-0.17/debian/compat bsd-finger-0.17/debian/compat --- bsd-finger-0.17/debian/compat 2009-06-10 09:47:58.000000000 +0000 +++ bsd-finger-0.17/debian/compat 2012-06-18 04:56:36.000000000 +0000 @@ -1 +1 @@ -7 +9 diff -Nru bsd-finger-0.17/debian/control bsd-finger-0.17/debian/control --- bsd-finger-0.17/debian/control 2010-02-12 03:49:07.000000000 +0000 +++ bsd-finger-0.17/debian/control 2012-06-18 05:39:52.000000000 +0000 @@ -2,8 +2,8 @@ Section: net Priority: optional Maintainer: Anibal Monsalve Salazar -Standards-Version: 3.8.4 -Build-Depends: debhelper (>= 7), quilt +Standards-Version: 3.9.3 +Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9) Package: finger Architecture: any @@ -14,7 +14,8 @@ Package: fingerd Architecture: any -Depends: update-inetd, netbase, finger, ${shlibs:Depends}, ${misc:Depends} +Depends: update-inetd, netbase, ${shlibs:Depends}, ${misc:Depends} +Suggests: finger Replaces: netstd Description: remote user information server Fingerd is a simple daemon based on RFC1196 that provides an interface to the diff -Nru bsd-finger-0.17/debian/patches/06-572211-decrease-timeout.patch bsd-finger-0.17/debian/patches/06-572211-decrease-timeout.patch --- bsd-finger-0.17/debian/patches/06-572211-decrease-timeout.patch 1970-01-01 00:00:00.000000000 +0000 +++ bsd-finger-0.17/debian/patches/06-572211-decrease-timeout.patch 2012-06-18 04:32:23.000000000 +0000 @@ -0,0 +1,75 @@ +Description: Decrease timeout length during connect(). + In cases where a name server is answering with A as well as AAAA records, + but the system to be queried has lost a corresponding address, the TCP + handshake timeout will cause a long delay before allowing the query of + the next address family, or the next address in general. + . + The use of a trivial signal handler for SIGALRM allows the reduction + of this timeout, thus producing better responsiveness for the interactive + user of the Finger service. +Author: Mats Erik Andersson +Forwarded: no +Last-Updated: 2010-03-02 + +--- a/finger/net.c ++++ b/finger/net.c +@@ -49,14 +49,25 @@ + #include + #include + #include ++#include + #include "finger.h" + ++#if ! defined(FINGER_TIMEOUT) || FINGER_TIMEOUT < 1 ++# define FINGER_TIMEOUT 5 ++#endif ++ ++static void trivial_alarm(int sig) { ++ /* Just to trigger EINTR, and to later use it. */ ++ return; ++} ++ + int netfinger(const char *name) { + register FILE *fp; + register int c, sawret, ateol; + struct addrinfo hints, *result, *resptr; + struct servent *sp; + struct sockaddr_storage sn; ++ struct sigaction sigact, oldsigact; + int s, status; + char *host; + +@@ -77,6 +88,10 @@ + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + ++ sigact.sa_handler = trivial_alarm; ++ sigemptyset(&sigact.sa_mask); ++ sigact.sa_flags = 0; ++ + status = getaddrinfo(host, "finger", &hints, &result); + if (status != 0) { + eprintf("finger: unknown host: %s\n", host); +@@ -95,13 +110,21 @@ + /* This should probably be removed. */ + /* xprintf("[%s]\n", result->ai_canonname); */ + ++ sigaction(SIGALRM, &sigact, &oldsigact); ++ alarm(FINGER_TIMEOUT); ++ + if (connect(s, resptr->ai_addr, resptr->ai_addrlen) < 0) { ++ if ( errno == EINTR ) ++ errno = ETIMEDOUT; + close(s); + continue; + } + ++ alarm(0); ++ sigaction(SIGALRM, &oldsigact, NULL); ++ + /* Connection is now established. +- /* Assemble the gained information. */ ++ * Assemble the gained information. */ + memcpy(&sn, resptr->ai_addr, resptr->ai_addrlen); + break; + } diff -Nru bsd-finger-0.17/debian/patches/series bsd-finger-0.17/debian/patches/series --- bsd-finger-0.17/debian/patches/series 2010-02-12 05:15:47.000000000 +0000 +++ bsd-finger-0.17/debian/patches/series 2012-06-18 05:07:56.000000000 +0000 @@ -3,3 +3,4 @@ 03-468454-fingerd-ipv6.patch 04-468454-finger-ipv6.patch 05-547014-netgroup.patch +06-572211-decrease-timeout.patch diff -Nru bsd-finger-0.17/debian/rules bsd-finger-0.17/debian/rules --- bsd-finger-0.17/debian/rules 2009-06-10 09:55:00.000000000 +0000 +++ bsd-finger-0.17/debian/rules 2012-06-18 05:38:00.000000000 +0000 @@ -3,36 +3,34 @@ # Copyright (c) 1999 Herbert Xu # Copyright (C) 2004-2008 Anibal Monsalve Salazar -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +export DH_VERBOSE=1 -# This has to be exported to make some magic below work. export DH_OPTIONS -include /usr/share/quilt/quilt.make - -build: patch build-stamp +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp build-stamp: dh_testdir - if [ ! -f MCONFIG ]; then \ ./configure; \ - sed -e 's/^CFLAGS=\(.*\)$$/CFLAGS= -g -D_GNU_SOURCE \1/' \ + sed -e "s/^CFLAGS=\(.*\)$$/CFLAGS=-g -D_GNU_SOURCE \1/;s/^LDFLAGS=\(.*\)$$/LDFLAGS=$$LDFLAGS \1/" \ MCONFIG > MCONFIG.new; \ mv MCONFIG.new MCONFIG; \ fi $(MAKE) - touch build-stamp -clean: unpatch +clean: dh_testdir dh_testroot rm -f build-stamp install-stamp - touch MCONFIG [ ! -f Makefile ] || $(MAKE) distclean - dh_clean install: DH_OPTIONS= @@ -42,21 +40,14 @@ dh_testroot dh_prep dh_installdirs - install finger/finger debian/finger/usr/bin install fingerd/fingerd debian/fingerd/usr/sbin/in.fingerd cp finger/finger.1 debian/finger/usr/share/man/man1 cp fingerd/fingerd.8 debian/fingerd/usr/share/man/man8/in.fingerd.8 - dh_strip touch install-stamp -# This single target is used to build all the packages, all at once, or -# one at a time. So keep in mind: any options passed to commands here will -# affect _all_ packages. Anything you want to only affect one package -# should be put in another target, such as the install target. binary-common: - # Need this version of debhelper for DH_OPTIONS to work. dh_testdir dh_testroot dh_installdocs @@ -72,18 +63,13 @@ dh_shlibdeps dh_gencontrol dh_md5sums - dh_builddeb + dh_builddeb -- -Zbzip2 -z9 -# Build architecture independant packages using the common target. binary-indep: install -# (Uncomment this next line if you have such packages.) -# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common -# Build architecture dependant packages using the common target. binary-arch: install $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common -# Any other binary targets build just one binary package at a time. binary-%: install make -f debian/rules binary-common DH_OPTIONS=-p$*