--- bsd-finger-0.17.orig/debian/control +++ bsd-finger-0.17/debian/control @@ -0,0 +1,23 @@ +Source: bsd-finger +Section: net +Priority: optional +Maintainer: Anibal Monsalve Salazar +Standards-Version: 3.8.1 +Build-Depends: debhelper (>= 7), quilt + +Package: finger +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Replaces: netstd +Description: user information lookup program + finger displays information about the system users. + +Package: fingerd +Architecture: any +Depends: update-inetd, netbase, finger, ${shlibs:Depends}, ${misc:Depends} +Replaces: netstd +Description: remote user information server + Fingerd is a simple daemon based on RFC1196 that provides an interface to the + "finger" program at most network sites. The program is supposed to return a + friendly, human-oriented status report on either the system at the moment or a + particular person in depth. --- bsd-finger-0.17.orig/debian/compat +++ bsd-finger-0.17/debian/compat @@ -0,0 +1 @@ +7 --- bsd-finger-0.17.orig/debian/watch +++ bsd-finger-0.17/debian/watch @@ -0,0 +1,2 @@ +version=3 +ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/ bsd-finger-([\d]+[\.\d]*).tar.gz --- bsd-finger-0.17.orig/debian/fingerd.dirs +++ bsd-finger-0.17/debian/fingerd.dirs @@ -0,0 +1,2 @@ +usr/sbin +usr/share/man/man8 --- bsd-finger-0.17.orig/debian/rules +++ bsd-finger-0.17/debian/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# GNU copyright 1997 to 1999 by Joey Hess. +# Copyright (c) 1999 Herbert Xu +# Copyright (C) 2004-2008 Anibal Monsalve Salazar + +# Uncomment this to turn on verbose mode. +#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 +build-stamp: + dh_testdir + + if [ ! -f MCONFIG ]; then \ + ./configure; \ + sed -e 's/^CFLAGS=\(.*\)$$/CFLAGS= -g -D_GNU_SOURCE \1/' \ + MCONFIG > MCONFIG.new; \ + mv MCONFIG.new MCONFIG; \ + fi + $(MAKE) + + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp install-stamp + + touch MCONFIG + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: DH_OPTIONS= +install: build install-stamp +install-stamp: + dh_testdir + 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 + dh_installexamples + dh_installmenu + dh_installcron + dh_installinfo + dh_installchangelogs ChangeLog + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# 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$* + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- bsd-finger-0.17.orig/debian/finger.dirs +++ bsd-finger-0.17/debian/finger.dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/man1 --- bsd-finger-0.17.orig/debian/copyright +++ bsd-finger-0.17/debian/copyright @@ -0,0 +1,16 @@ +This package was split from netstd by Herbert Xu herbert@debian.org on +Wed, 3 Nov 1999 10:03:41 +1100. + +It is maintained by Anibal Monsalve Salazar . + +netstd was created by Peter Tobias tobias@et-inf.fho-emden.de on +Wed, 20 Jul 1994 17:23:21 +0200. + +It was downloaded from ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/. + +Copyright: + +Copyright (c) 1980-1991 The Regents of the University of California. + +The license can be found in /usr/share/common-licenses/BSD. + --- bsd-finger-0.17.orig/debian/fingerd.postinst +++ bsd-finger-0.17/debian/fingerd.postinst @@ -0,0 +1,32 @@ +#!/bin/sh -e +# $Id: fingerd.postinst,v 1.1 1999/11/03 00:43:02 herbert Exp $ + +enable_if_alone() { + if ! grep -q ^finger /etc/inetd.conf; then + update-inetd --pattern /usr/sbin/in\\.fingerd --enable finger + fi +} + +case "$1" in +abort-upgrade | abort-deconfigure | abort-remove) + enable_if_alone + ;; +configure) + if [ -n "$2" ]; then + enable_if_alone + else + fingerentry="finger stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/in.fingerd" + if grep -q ^finger /etc/inetd.conf; then + update-inetd --group INFO --add "#$fingerentry" + else + update-inetd --group INFO --add "$fingerentry" + fi + fi + ;; +*) + printf "$0: incorrect arguments: $*\n" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- bsd-finger-0.17.orig/debian/fingerd.postrm +++ bsd-finger-0.17/debian/fingerd.postrm @@ -0,0 +1,19 @@ +#!/bin/sh -e + +case "$1" in +abort-install | remove | abort-upgrade | upgrade | failed-upgrade | disappear) + ;; +purge) + # If netbase is not installed, then we don't need to do the remove. + #if command -v update-inetd >/dev/null 2>&1; then + if [ -x /usr/sbin/update-inetd ]; then + update-inetd --remove "finger .* /usr/sbin/in\.fingerd" + fi + ;; +*) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- bsd-finger-0.17.orig/debian/finger.docs +++ bsd-finger-0.17/debian/finger.docs @@ -0,0 +1 @@ +BUGS --- bsd-finger-0.17.orig/debian/fingerd.prerm +++ bsd-finger-0.17/debian/fingerd.prerm @@ -0,0 +1,6 @@ +#!/bin/sh -e +# $Id: fingerd.prerm,v 1.2 2001/03/20 10:33:23 herbert Exp $ + +update-inetd --pattern /usr/sbin/in\\.fingerd --disable finger + +#DEBHELPER# --- bsd-finger-0.17.orig/debian/changelog +++ bsd-finger-0.17/debian/changelog @@ -0,0 +1,149 @@ +bsd-finger (0.17-13) unstable; urgency=low + + * Priority is optional + * Build depends on quilt + * Standards Version is 3.8.1 + * DH compatibility level is 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 + + -- Anibal Monsalve Salazar Wed, 10 Jun 2009 19:49:18 +1000 + +bsd-finger (0.17-12) unstable; urgency=low + + * Added debian/watch + * Fixed the following lintian issues: + - bsd-finger source: debian-rules-sets-DH_COMPAT line 10 + - bsd-finger source: debian-rules-ignores-make-clean-error line 34 + - bsd-finger source: out-of-date-standards-version 3.7.2 (current is 3.7.3) + + -- Anibal Monsalve Salazar Sun, 06 Apr 2008 17:30:13 +1000 + +bsd-finger (0.17-11) unstable; urgency=low + + * Resynchronise with Ubuntu. + + -- Anibal Monsalve Salazar Fri, 09 Feb 2007 10:43:05 +1100 + +bsd-finger (0.17-10ubuntu1) feisty; urgency=low + + * Make fingerd depend on update-inetd for update-inetd. + + -- Tollef Fog Heen Thu, 14 Dec 2006 11:40:14 +0100 + +bsd-finger (0.17-10) unstable; urgency=low + + * Set Standards-Version to 3.7.2. + * Set DH_COMPAT to 5. + + -- Anibal Monsalve Salazar Thu, 22 Jun 2006 09:03:02 +1000 + +bsd-finger (0.17-9) unstable; urgency=low + + * Set Standards-Version to 3.6.2. + * Set DH_COMPAT to 4. + * Fixed "fingerd.postrm is a #!/bin/sh script but uses command + -v", closes: #292977. + * Fixed "/usr/share/doc/finger/README.gz not helpful for user", + closes: #323230. + + -- Anibal Monsalve Salazar Sat, 08 Oct 2005 19:10:10 +1000 + +bsd-finger (0.17-8) unstable; urgency=low + + * Fixed "Manpage mentions ~/.pgp when it should say ~/.pgpkey" + (Closes: #244217). + * Fixed "Manpage describes ~/.project as restricted to one line" + (Closes: #244218). + * New maintainer's email address. + + -- Anibal Monsalve Salazar Thu, 10 Feb 2005 23:22:52 +1100 + +bsd-finger (0.17-7) unstable; urgency=low + + * New maintainer. + + -- Anibal Monsalve Salazar Thu, 20 May 2004 09:24:26 +1000 + +bsd-finger (0.17-6) unstable; urgency=low + + * Exit with a nonzero status when a request fails (closes: #122915). + + -- Herbert Xu Sat, 8 Dec 2001 18:39:54 +1100 + +bsd-finger (0.17-5) unstable; urgency=low + + * Use asprintf in preference to an array on the stack (closes: #106385). + + -- Herbert Xu Tue, 24 Jul 2001 19:25:14 +1000 + +bsd-finger (0.17-4) unstable; urgency=low + + * Restored old strsep code since gecos may be empty (closes: #103273). + + -- Herbert Xu Tue, 3 Jul 2001 21:24:19 +1000 + +bsd-finger (0.17-3) unstable; urgency=low + + * Finger no longer complains about remote X displays. + + -- Herbert Xu Tue, 19 Jun 2001 22:21:25 +1000 + +bsd-finger (0.17-2) unstable; urgency=low + + * Fixed typo in finger(1) man page (closes: #99328). + + -- Herbert Xu Thu, 31 May 2001 19:17:12 +1000 + +bsd-finger (0.17-1) unstable; urgency=low + + * New upstream release. + * Fixed compilation problems with glibc 2.2 (closes: #90356). + + -- Herbert Xu Tue, 20 Mar 2001 21:30:56 +1100 + +bsd-finger (0.16-3) unstable; urgency=low + + * Set pn->realname to NULL by default (closes: #67593). + + -- Herbert Xu Sun, 23 Jul 2000 14:12:52 +1000 + +bsd-finger (0.16-2) unstable; urgency=low + + * Fixed a null pointer dereference (closes: #66829). Reported and fixed by + Peter Toneby. + * Added build-time dependency on debhelper. + + -- Herbert Xu Fri, 7 Jul 2000 19:09:11 +1000 + +bsd-finger (0.16-1) unstable; urgency=low + + * New upstream release. + * Added .pgpkey to finger.1 (closes: #65632). + + -- Herbert Xu Mon, 19 Jun 2000 14:58:04 +1000 + +bsd-finger (0.10-3) frozen unstable; urgency=low + + * Clear the idle time if we cannot obtain a valid value, which is the case + for X logins (closes: #53816). + + -- Herbert Xu Tue, 21 Mar 2000 22:09:23 +1100 + +bsd-finger (0.10-2) unstable; urgency=low + + * Fixed finger width calculation (closes: #49510). + + -- Herbert Xu Thu, 11 Nov 1999 20:11:24 +1100 + +bsd-finger (0.10-1) unstable; urgency=low + + * Initial release. + * Don't print an error message if we can't open a tty file as it may be a + remote X login. + * finger now supports pts devices (closes: #39196, #41552, #43342, #43952). + + -- Herbert Xu Wed, 3 Nov 1999 10:00:20 +1100 + --- bsd-finger-0.17.orig/debian/patches/01-legacy.patch +++ bsd-finger-0.17/debian/patches/01-legacy.patch @@ -0,0 +1,328 @@ +--- a/finger/finger.1 2000-07-31 09:56:57.000000000 +1000 ++++ b/finger/finger.1 2009-06-10 20:08:45.000000000 +1000 +@@ -169,16 +169,14 @@ started by + must be able to see the + .Pa .nofinger + file. This generally means that the home directory containing the file +-must have the other-users-execute bit set (o+w). See ++must have the other-users-execute bit set (o+x). See + .Xr chmod 1 . + If you use this feature for privacy, please test it with ``finger + @localhost'' before relying on it, just in case. + .It ~/.plan + .It ~/.project +-.It ~/.pgp ++.It ~/.pgpkey + These files are printed as part of a long-format request. The +-.Pa .project +-file is limited to one line; the + .Pa .plan + file may be arbitrarily long. + .El +--- a/finger/finger.c 1999-12-19 03:41:51.000000000 +1100 ++++ b/finger/finger.c 2009-06-10 20:08:45.000000000 +1000 +@@ -77,7 +77,7 @@ char finger_rcsid[] = \ + #include "../version.h" + + static void loginlist(void); +-static void userlist(int argc, char *argv[]); ++static int userlist(int argc, char *argv[]); + + int lflag, pplan; + static int sflag, mflag; +@@ -92,6 +92,7 @@ int entries; /* number of people */ + + int main(int argc, char *argv[]) { + int ch; ++ int err = 0; + struct sockaddr_in sin; + socklen_t slen = sizeof(sin); + +@@ -159,7 +160,7 @@ int main(int argc, char *argv[]) { + } + } + else { +- userlist(argc, argv); ++ err = userlist(argc, argv); + /* + * Assign explicit "large" format if names given and -s not + * explicitly stated. Force the -l AFTER we get names so any +@@ -172,7 +173,7 @@ int main(int argc, char *argv[]) { + if (lflag) lflag_print(); + else sflag_print(); + } +- return 0; ++ return err; + } + + /* Returns 1 if .nofinger is found and enable_nofinger is set. */ +@@ -181,10 +182,16 @@ int + check_nofinger(struct passwd *pw) + { + if (enable_nofinger) { +- char path[PATH_MAX]; + struct stat tripe; +- snprintf(path, sizeof(path), "%s/.nofinger", pw->pw_dir); +- if (stat(path, &tripe)==0) { ++ int ret; ++ char *path; ++ if (asprintf(&path, "%s/.nofinger", pw->pw_dir) < 0) { ++ eprintf("finger: Out of space.\n"); ++ exit(1); ++ } ++ ret = stat(path, &tripe); ++ free(path); ++ if (!ret) { + return 1; + } + } +@@ -264,10 +271,11 @@ static void do_local(int argc, char *arg + + } + +-static void ++static int + userlist(int argc, char *argv[]) + { + int i; ++ int err = 0; + PERSON *pn; + PERSON *nethead, **nettail; + struct utmp *uptr; +@@ -297,13 +305,13 @@ userlist(int argc, char *argv[]) + + /* handle network requests */ + for (pn = nethead; pn; pn = pn->next) { +- netfinger(pn->name); ++ err |= netfinger(pn->name); + if (pn->next || entries) + xputc('\n'); + } + + if (entries == 0) +- return; ++ return err; + + /* + * Scan thru the list of users currently logged in, saving +@@ -331,4 +339,6 @@ userlist(int argc, char *argv[]) + enter_lastlog(pn); + } + endutent(); ++ ++ return err; + } +--- a/finger/finger.h 1999-09-14 20:51:11.000000000 +1000 ++++ b/finger/finger.h 2009-06-10 20:08:45.000000000 +1000 +@@ -92,7 +92,7 @@ void sflag_print(void); + void enter_where(struct utmp *ut, PERSON *pn); + void enter_lastlog(PERSON *pn); + int match(struct passwd *pw, const char *user); +-void netfinger(const char *name); ++int netfinger(const char *name); + const char *prphone(const char *num); + + #ifndef DAYSPERNYEAR +--- a/finger/lprint.c 1999-09-14 20:51:11.000000000 +1000 ++++ b/finger/lprint.c 2009-06-10 20:08:45.000000000 +1000 +@@ -48,7 +48,7 @@ char lprint_rcsid[] = + #include + #include + #include +-#include ++#include + #include "finger.h" + + static void lprint(PERSON *pn); +@@ -100,7 +100,7 @@ lprint(PERSON *pn) + * office, office phone, home phone if available + */ + xprintf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s", +- pn->name, pn->realname, pn->dir); ++ pn->name, pn->realname ? pn->realname : "", pn->dir); + xprintf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL); + + /* +--- a/finger/net.c 1999-09-14 20:51:11.000000000 +1000 ++++ b/finger/net.c 2009-06-10 20:08:45.000000000 +1000 +@@ -51,7 +51,7 @@ char net_rcsid[] = "$Id: net.c,v 1.9 199 + #include + #include "finger.h" + +-void netfinger(const char *name) { ++int netfinger(const char *name) { + register FILE *fp; + struct in_addr defaddr; + register int c, sawret, ateol; +@@ -62,7 +62,7 @@ void netfinger(const char *name) { + char *alist[1], *host; + + host = strrchr(name, '@'); +- if (!host) return; ++ if (!host) return 1; + *host++ = '\0'; + + memset(&sn, 0, sizeof(sn)); +@@ -70,7 +70,7 @@ void netfinger(const char *name) { + sp = getservbyname("finger", "tcp"); + if (!sp) { + eprintf("finger: tcp/finger: unknown service\n"); +- return; ++ return 1; + } + sn.sin_port = sp->s_port; + +@@ -78,7 +78,7 @@ void netfinger(const char *name) { + if (!hp) { + if (!inet_aton(host, &defaddr)) { + eprintf("finger: unknown host: %s\n", host); +- return; ++ return 1; + } + def.h_name = host; + def.h_addr_list = alist; +@@ -96,7 +96,7 @@ void netfinger(const char *name) { + + if ((s = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) { + eprintf("finger: socket: %s\n", strerror(errno)); +- return; ++ return 1; + } + + /* print hostname before connecting, in case it takes a while */ +@@ -104,7 +104,7 @@ void netfinger(const char *name) { + if (connect(s, (struct sockaddr *)&sn, sizeof(sn)) < 0) { + eprintf("finger: connect: %s\n", strerror(errno)); + close(s); +- return; ++ return 1; + } + + /* -l flag for remote fingerd */ +@@ -128,7 +128,7 @@ void netfinger(const char *name) { + if (!fp) { + eprintf("finger: fdopen: %s\n", strerror(errno)); + close(s); +- return; ++ return 1; + } + + sawret = 0; +@@ -152,4 +152,6 @@ void netfinger(const char *name) { + } + if (!ateol) xputc('\n'); + fclose(fp); ++ ++ return 0; + } +--- a/finger/sprint.c 1999-12-13 05:59:33.000000000 +1100 ++++ b/finger/sprint.c 2009-06-10 20:08:45.000000000 +1000 +@@ -40,7 +40,7 @@ char sprint_rcsid[] = "$Id: sprint.c,v 1 + #endif /* not lint */ + + #include +-#include ++#include + #include + #include + #include +--- a/finger/util.c 1999-09-29 08:53:58.000000000 +1000 ++++ b/finger/util.c 2009-06-10 20:08:45.000000000 +1000 +@@ -64,7 +64,7 @@ static void find_idle_and_ttywrite(regis + struct stat sb; + + /* No device for X console. Utmp entry by XDM login (":0"). */ +- if (w->tty[0] == ':') { ++ if (strchr(w->tty, ':')) { + w->idletime = 0; /* would be nice to have it emit ??? */ + w->writable = 0; + return; +@@ -109,9 +109,8 @@ static void userinfo(PERSON *pn, struct + * fields[3] -> homephone + */ + nfields = 0; +- for (p = strtok(bp, ","); p; p = strtok(NULL, ",")) { +- if (*p==0) p = NULL; // skip empties +- if (nfields < 4) fields[nfields++] = p; ++ while ((p = strsep(&bp, ","))) { ++ if (nfields < 4) fields[nfields++] = *p ? p : NULL; + } + while (nfields<4) fields[nfields++] = NULL; + +@@ -150,6 +149,9 @@ static void userinfo(PERSON *pn, struct + + pn->realname = rname; + } ++ else { ++ pn->realname = NULL; ++ } + + pn->office = fields[1] ? strdup(fields[1]) : NULL; + pn->officephone = fields[2] ? strdup(fields[2]) : NULL; +--- a/fingerd/fingerd.8 2000-07-31 09:56:57.000000000 +1000 ++++ b/fingerd/fingerd.8 2009-06-10 20:08:45.000000000 +1000 +@@ -36,10 +36,10 @@ + .Dt FINGERD 8 + .Os "Linux NetKit (0.17)" + .Sh NAME +-.Nm fingerd ++.Nm in.fingerd + .Nd remote user information server + .Sh SYNOPSIS +-.Nm fingerd ++.Nm in.fingerd + .Op Fl wulf + .Op Fl pL Ar path + .Op Fl t Ar timeout +@@ -61,7 +61,7 @@ option is given, remote users will get a + banner + which also shows some informations (e.g. uptime, operating system name and + release) about the system the +-.Nm fingerd ++.Nm in.fingerd + is running on. Some sites may consider this a security risk as it + gives out information that may be useful to crackers. + .Pp +@@ -85,7 +85,7 @@ resource reasons. + .Pp + The + .Fl p +-option allows specification of an alternate location for fingerd to find ++option allows specification of an alternate location for in.fingerd to find + the + .Dq finger + program. The +@@ -97,7 +97,7 @@ The + option specifies the time to wait for a request before closing the + connection. A value of 0 waits forever. The default is 60 seconds. + .Pp +-Options to fingerd should be specified in ++Options to in.fingerd should be specified in + .Pa /etc/inetd.conf . + .Pp + The finger protocol consists mostly of specifying command arguments. +@@ -105,12 +105,12 @@ The + .Xr inetd 8 + .Dq super-server + runs +-.Nm fingerd ++.Nm in.fingerd + for + .Tn TCP + requests received on port 79. + Once connected +-.Nm fingerd ++.Nm in.fingerd + reads a single command line + terminated by a + .Aq Tn CRLF +--- a/fingerd/fingerd.c 1999-12-13 05:46:28.000000000 +1100 ++++ b/fingerd/fingerd.c 2009-06-10 20:08:45.000000000 +1000 +@@ -55,6 +55,7 @@ char rcsid[] = + #include + #include + #include ++#include + + #include "pathnames.h" + #include "../version.h" --- bsd-finger-0.17.orig/debian/patches/02-518559-nsswitch-sources.patch +++ bsd-finger-0.17/debian/patches/02-518559-nsswitch-sources.patch @@ -0,0 +1,98 @@ +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518559 + +Doesn't work with a non-iterable nsswitch source + +Currently, "finger tabbott" works by iterating through the list of users +on the system using getpwent and checking if any of them match "tabbott". + +Some nsswitch backends (including Hesiod and LDAP[1]) do not support +iterating through the complete list of users. These nsswitch backends +instead only fully support looking up a user's information by username or +uid. + +So, if tabbott is a user whose nsswitch information comes from LDAP, then +"finger tabbott" will incorrectly report "finger: tabbott: no such user." +"finger -m tabbott" does work correctly, however, because it looks up the +matching username using getpwnam. + +A fix for this is to always look up an argument to finger for a username +match, and having -m only control whether finger searches the entire user +database for real name matches. Patch attached. + +This patch has the advantageous side effect that if there are some real +name matches and a username match, finger will always display the username +match first (rather than in some random place in the list). + + -Tim Abbott + +[1] with LDAP, it is typically the case that one can iterate through only +the first 100 results from a query. + +Tim Abbott + +commit ab0b4e09b1281a11587fd0f9797e612cfb08ef57 +Author: Timothy G Abbott +Date: Fri Mar 6 22:30:00 2009 -0500 + + Add support for non-iterable nsswitch sources. + + Signed-off-by: Timothy G Abbott + +diff --git a/finger/finger.c b/finger/finger.c +index 7b96d3c..5737782 100644 +--- a/finger/finger.c ++++ b/finger/finger.c +@@ -241,28 +241,35 @@ static void do_local(int argc, char *argv[], int *used) { + int i; + struct passwd *pw; + ++ for (i = 0; i < argc; i++) { ++ if (used[i] >= 0 && (pw = getpwnam(argv[i]))) { ++ if (!check_nofinger(pw)) { ++ enter_person(pw); ++ used[i] = 1; ++ } ++ } ++ } + /* +- * traverse the list of possible login names and check the login name +- * and real name against the name specified by the user. ++ * Traverse the list of users and check the real name against ++ * the name specified by the user. ++ * ++ * Since we've already entered users whose usernames match, ++ * ignore them when doing real name matching. + */ +- if (mflag) { +- for (i = 0; i < argc; i++) +- if (used[i] >= 0 && (pw = getpwnam(argv[i]))) { +- if (!check_nofinger(pw)) { +- enter_person(pw); +- used[i] = 1; +- } +- } +- } else for (pw = getpwent(); pw; pw = getpwent()) +- for (i = 0; i < argc; i++) +- if (used[i] >= 0 && +- (!strcasecmp(pw->pw_name, argv[i]) || +- match(pw, argv[i]))) { +- if (!check_nofinger(pw)) { +- enter_person(pw); +- used[i] = 1; ++ if (!mflag) { ++ for (pw = getpwent(); pw; pw = getpwent()) { ++ for (i = 0; i < argc; i++) { ++ if (used[i] >= 0 && ++ strcasecmp(pw->pw_name, argv[i]) && ++ match(pw, argv[i])) { ++ if (!check_nofinger(pw)) { ++ enter_person(pw); ++ used[i] = 1; ++ } + } + } ++ } ++ } + + /* list errors */ + for (i = 0; i < argc; i++) --- bsd-finger-0.17.orig/debian/patches/series +++ bsd-finger-0.17/debian/patches/series @@ -0,0 +1,2 @@ +01-legacy.patch +02-518559-nsswitch-sources.patch