diff -pruN 1.4.3-3.2/Configure 1.4.3-5/Configure
--- 1.4.3-3.2/Configure	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/Configure	1999-09-04 22:39:24.000000000 +0000
@@ -17,10 +17,10 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-require './perl/question.pl';
-require './perl/filemagic.pl';
-require './perl/gethost.pl';
-require './perl/generic.pl';
+require 'perl/question.pl';
+require 'perl/filemagic.pl';
+require 'perl/gethost.pl';
+require 'perl/generic.pl';
 
 $VERSION = "1.4.2";
 $| = 1;
diff -pruN 1.4.3-3.2/CREDITS 1.4.3-5/CREDITS
--- 1.4.3-3.2/CREDITS	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/CREDITS	1999-08-29 17:45:44.000000000 +0000
@@ -48,7 +48,7 @@ Dan Hollis <root@sasami.anime.net>
 	- Shadow password testing
 	- Secure (NOBODY PATCH) finger help
 
-David Muench <cc@spork.neonexus.com>
+cc@spork.neonexus.com
 	- Finger forwarding idea
 
 Rich Salz <rsalz@uunet.net>
@@ -76,13 +76,3 @@ Tadek Knapik <tadek@nautilus.uwoj.krakow
 
 Alexey M. Zelkin <phantom@cris.net>
 	- Support for FreeBSD
-
-Kevin Rosenberg <kevin@cyberport.com>
-	- Get UTMP file entries for BSD compatibility
-
-Thomas Koenig <ig25@rz.uni-karlsruhe.de>
-	- Management of e?uid switching
-
-Lars Mathiesen <thorinn@diku.dk>
-	- ABORT code for wildmat
-
diff -pruN 1.4.3-3.2/debian/changelog 1.4.3-5/debian/changelog
--- 1.4.3-3.2/debian/changelog	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/debian/changelog	2020-09-23 11:12:44.000000000 +0000
@@ -1,3 +1,39 @@
+cfingerd (1.4.3-5) unstable; urgency=medium
+
+  * QA upload.
+  * Make the build reproducible (Closes: #831021)
+    - Update upstream's Configure script to not embed the build time.
+    - Avoid timestamped gzip files in binary packages.
+  * Call dh_auto_build over $(MAKE) to pass cross-building tools to upstream
+    build system. Thanks, Helmut Grohne. (Closes: #956826)
+  * Unapply patches in debian/patches from main source tree.
+  * debian/rules:
+    - Set Rules-Requires-Root to "binary-targets".
+    - Correct location of Homepage field.
+    - Move Homepage field to HTTPS.
+    - Drop unnecessary "source", "version" and "revision" assignments in
+      debian/rules.
+    - Drop outdated "source diff", "dsc" and "dist" targets.
+  * Fix the syntax in a large number of debian/changelog entries.
+
+ -- Chris Lamb <lamby@debian.org>  Wed, 23 Sep 2020 12:12:44 +0100
+
+cfingerd (1.4.3-4) unstable; urgency=medium
+
+  * QA upload.
+  * Fix ftbfs with GCC-10. (Closes: #957081)
+  * Mark source format as 3.0
+    - Import old diff in quilt format.
+  * Orphan the package. (See: #934415)
+  * Update Standards-Version to 4.5.0
+    - Update priority to optional.
+  * Use debhelper-compat.
+    - Update compat level to 13.
+  * Add salsa as Vcs.
+  * Remove whitespace from d/changelog and d/rules.
+
+ -- Sudip Mukherjee <sudipm.mukherjee@gmail.com>  Sat, 25 Jul 2020 23:18:14 +0100
+
 cfingerd (1.4.3-3.2) unstable; urgency=medium
 
   * Non-maintainer upload.
@@ -113,7 +149,7 @@ cfingerd (1.4.1-1) unstable; urgency=low
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sun, 29 Aug 1999 20:16:14 +0200
 
-cfingerd (1.4.0-1) unstable; urgency=high, closes=39574 33667
+cfingerd (1.4.0-1) unstable; urgency=high
 
   * New upstream version
   * Russ Coker's patch wrt. qmail was applied (closes: Bug#39574)
@@ -123,7 +159,7 @@ cfingerd (1.4.0-1) unstable; urgency=hig
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Mon,  9 Aug 1999 12:04:18 +0200
 
-cfingerd (1.3.2-19) unstable; urgency=low, closes=33408 32924
+cfingerd (1.3.2-19) unstable; urgency=low
 
   * Fixed bug wrt empty .plan files (closes: Bug#33408)
   * Also added -g to Makefiles.
@@ -132,14 +168,14 @@ cfingerd (1.3.2-19) unstable; urgency=lo
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Mon, 15 Feb 1999 21:02:12 +0100
 
-cfingerd (1.3.2-18) frozen unstable; urgency=low, closes=31488 31489
+cfingerd (1.3.2-18) frozen unstable; urgency=low
 
   * Corrected mail directory to /var/spool in conffile (closes: Bug#31488)
   * Corrected current year to 1999 in all banner files (closes: Bug#31489)
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Wed,  6 Jan 1999 00:34:14 +0100
 
-cfingerd (1.3.2-17) frozen unstable; urgency=medium, closes=31243
+cfingerd (1.3.2-17) frozen unstable; urgency=medium
 
   * cfingerd now uses the same IP number on which it receives a request to
     connect to a remote ident server.  Thanks for help from Torsten
@@ -148,7 +184,7 @@ cfingerd (1.3.2-17) frozen unstable; urg
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue,  5 Jan 1999 01:18:18 +0100
 
-cfingerd (1.3.2-16) frozen unstable; urgency=low, closes=24904 24969 27779 24897 24895
+cfingerd (1.3.2-16) frozen unstable; urgency=low
 
   * Increased limit of tty per user, now I'm fingerable again. :)
   * Don't cut off random parts of the domain when it's too long, cut it at
@@ -175,21 +211,21 @@ cfingerd (1.3.2-16) frozen unstable; urg
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sat, 19 Dec 1998 18:34:09 +0100
 
-cfingerd (1.3.2-15) unstable; urgency=low, closes=28479
+cfingerd (1.3.2-15) unstable; urgency=low
 
   * Fixed thinko in src/userlist.c which caused userlist to stop
     working. (closes: Bug#28479)
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sat, 24 Oct 1998 15:45:53 +0200
 
-cfingerd (1.3.2-14) unstable; urgency=low, closes=28142
+cfingerd (1.3.2-14) unstable; urgency=low
 
   * Fixed typo in userlist/display.c which crashed userlist (closes: Bug#28142)
   * Fixed thinko in postrm
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 22 Oct 1998 12:55:48 +0200
 
-cfingerd (1.3.2-12) unstable; urgency=medium, closes=24898 24903 24905 24906 24907 24908 24909 24901 24964 24965 24966 25849
+cfingerd (1.3.2-12) unstable; urgency=medium
 
   * Converted all dangerous occurrances of sprintf() to snprintf()
   * Converted all dangerous occurrances of strcpy() to strncpy()
@@ -222,13 +258,13 @@ cfingerd (1.3.2-11.0) stable unstable; u
 
  -- John Goerzen <jgoerzen@complete.org>  Thu, 23 Jul 1998 22:16:40 -0500
 
-cfingerd (1.3.2-11) frozen unstable; urgency=low, closes=23050
+cfingerd (1.3.2-11) frozen unstable; urgency=low
 
   * Added /etc/cron.weekly/cfingerd as conffile (closes: Bug#23050)
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Mon, 8 Jun 1998 01:40:28 +0200
 
-cfingerd (1.3.2-10) frozen unstable; urgency=low, closes=23039 22816
+cfingerd (1.3.2-10) frozen unstable; urgency=low
 
   * Added support for non-world-writable tty's owned by group tty (closes:
     Bug#23039)
@@ -241,7 +277,7 @@ cfingerd (1.3.2-10) frozen unstable; urg
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sun, 31 May 1998 22:53:49 +0200
 
-cfingerd (1.3.2-9) frozen unstable; urgency=medium, closes=21230 21566
+cfingerd (1.3.2-9) frozen unstable; urgency=medium
 
   * Corrected search_fake() which depended on 80 char strings but received
     a 100 character one.  (closes: Bug#21230)
@@ -254,7 +290,7 @@ cfingerd (1.3.2-9) frozen unstable; urge
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue, 12 May 1998 00:52:11 +0200
 
-cfingerd (1.3.2-8) frozen unstable; urgency=low, closes=19982
+cfingerd (1.3.2-8) frozen unstable; urgency=low
 
   * Priority switched to extra as of request by IanJ
   * Moved scripts from /etc to /usr/doc
@@ -264,7 +300,7 @@ cfingerd (1.3.2-8) frozen unstable; urge
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sat, 11 Apr 1998 10:16:50 +0200
 
-cfingerd (1.3.2-7) unstable; urgency=low, closes=19121 19200
+cfingerd (1.3.2-7) unstable; urgency=low
 
   * Removed setuid bit from userlist (lintian)
   * Corrected ownership for control scripts (lintian)
@@ -275,23 +311,23 @@ cfingerd (1.3.2-7) unstable; urgency=low
   * Added patch to support Qmail mailboxes, thanks to Russell Coker
     <rjc@snoopy.virtual.net.au>
   * Updated manpage properly
-  
+
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue, 10 Mar 1998 05:52:52 +0100
 
-cfingerd (1.3.2-6) unstable; urgency=low, closes=17639
-  
+cfingerd (1.3.2-6) unstable; urgency=low
+
   * Corrected FSF's address (lintian)
   * Flagged SIGPIPE as fatal (closes: Bug#17639)
-  
+
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Wed, 11 Feb 1998 11:27:06 +0100
 
-cfingerd (1.3.2-5) unstable; urgency=low, closes=16752
+cfingerd (1.3.2-5) unstable; urgency=low
 
   * Corrected Standards-Version to 2.3.0.1 (Bug#16752)
 
  -- Martin Schulze <joey@finlandia.infodrom.north.de>  Fri, 9 Jan 1998 01:59:25 +0100
 
-cfingerd (1.3.2-4) unstable; urgency=low, closes=12405 14546 16244
+cfingerd (1.3.2-4) unstable; urgency=low
 
   * Changed tail +3 to tail +2 in src/usrlist.c (Bug#12405)
   * Linked against libc6
@@ -334,12 +370,12 @@ cfingerd (1.3.2-2) unstable; urgency=low
 
 cfingerd (1.3.2-1) unstable; urgency=low
 
-  * Removed -m486 in all Makefiles, 
+  * Removed -m486 in all Makefiles,
   * src/search.c: If the internal search.*@ is used the whole
     GCOS field won't be sent out anymore.
   * Removed investigation of the hostname within Configure script
   * Converted into new packaging scheme
-  
+
  -- Martin Schulze <joey@infodrom.north.de>  Sun, 23 Feb 1997 12:21:29 +0100
 
 cfingerd (1.3.0-1) unstable; urgency=low
@@ -420,4 +456,3 @@ Wed May 15 20:05:53 1996  Martin Schulze
 Wed May 5 13:20:21 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
 
 	* Added Debian packaging files.
-
diff -pruN 1.4.3-3.2/debian/compat 1.4.3-5/debian/compat
--- 1.4.3-3.2/debian/compat	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/debian/compat	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-7
diff -pruN 1.4.3-3.2/debian/control 1.4.3-5/debian/control
--- 1.4.3-3.2/debian/control	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/debian/control	2020-09-23 11:12:44.000000000 +0000
@@ -1,9 +1,13 @@
 Source: cfingerd
 Section: net
-Priority: extra
-Maintainer: Martin Schulze <joey@debian.org>
-Build-Depends: debhelper (>= 7)
-Standards-Version: 3.8.4
+Priority: optional
+Maintainer: Debian QA Group <packages@qa.debian.org>
+Build-Depends: debhelper-compat (= 13)
+Standards-Version: 4.5.0
+Vcs-Git: https://salsa.debian.org/debian/cfingerd.git
+Vcs-Browser: https://salsa.debian.org/debian/cfingerd
+Rules-Requires-Root: binary-targets
+Homepage: https://www.infodrom.org/projects/cfingerd/
 
 Package: cfingerd
 Architecture: any
@@ -17,4 +21,3 @@ Description: configurable finger daemon
  able to respond to a finger request to a specified user by running a
  shell script (e.g., finger doorbell@mysite.mydomain might cause a
  sound file to be sent) rather than just a plain text file.
-Homepage: http://www.infodrom.org/projects/cfingerd/
diff -pruN 1.4.3-3.2/debian/patches/fix_ftbfs.patch 1.4.3-5/debian/patches/fix_ftbfs.patch
--- 1.4.3-3.2/debian/patches/fix_ftbfs.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1.4.3-5/debian/patches/fix_ftbfs.patch	2020-09-23 11:12:44.000000000 +0000
@@ -0,0 +1,70 @@
+From: Unknown
+Date: Wed, 23 Sep 2020 11:53:26 +0100
+Subject: Fix FTBFS with gcc-10
+
+Author: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Bug-Debian: https://bugs.debian.org/957081
+Forwarded: no
+---
+ src/cfingerd.h      | 2 +-
+ src/options.c       | 4 ++++
+ userlist/main.c     | 4 ++++
+ userlist/userlist.h | 2 +-
+ 4 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/cfingerd.h b/src/cfingerd.h
+index 97ba635..0345a76 100644
+--- a/src/cfingerd.h
++++ b/src/cfingerd.h
+@@ -52,7 +52,7 @@
+ #endif
+ 
+ #if !defined(UT_USERSIZE) ||  !defined(UT_HOSTSIZE) ||  !defined(UT_LINESIZE) ||  !defined(UT_NAMESIZE)
+-struct utmp foo_utmp;
++extern struct utmp foo_utmp;
+ #endif
+ 
+ #ifndef UT_USERSIZE
+diff --git a/src/options.c b/src/options.c
+index e832175..af0ba18 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -18,6 +18,10 @@
+ 
+ #include "version.h"
+ 
++#if !defined(UT_USERSIZE) ||  !defined(UT_HOSTSIZE) ||  !defined(UT_LINESIZE) ||  !defined(UT_NAMESIZE)
++struct utmp foo_utmp;
++#endif
++
+ /*
+  * SET_DAEMON_MODE
+  *
+diff --git a/userlist/main.c b/userlist/main.c
+index c68b457..c85bcf3 100644
+--- a/userlist/main.c
++++ b/userlist/main.c
+@@ -10,6 +10,10 @@
+ #include "userlist.h"
+ #include "proto.h"
+ 
++#if !defined(UT_USERSIZE) ||  !defined(UT_HOSTSIZE) ||  !defined(UT_LINESIZE) ||  !defined(UT_NAMESIZE)
++struct utmp foo_utmp;
++#endif
++
+ int main(int argc, char *argv[])
+ {
+     initialize_userlist();
+diff --git a/userlist/userlist.h b/userlist/userlist.h
+index 57166a5..f1a70ad 100644
+--- a/userlist/userlist.h
++++ b/userlist/userlist.h
+@@ -55,7 +55,7 @@ typedef struct {
+ #endif
+ 
+ #if !defined(UT_USERSIZE) ||  !defined(UT_HOSTSIZE) ||  !defined(UT_LINESIZE) ||  !defined(UT_NAMESIZE)
+-struct utmp foo_utmp;
++extern struct utmp foo_utmp;
+ #endif
+ 
+ #ifndef UT_USERSIZE
diff -pruN 1.4.3-3.2/debian/patches/import_diff.patch 1.4.3-5/debian/patches/import_diff.patch
--- 1.4.3-3.2/debian/patches/import_diff.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1.4.3-5/debian/patches/import_diff.patch	2020-09-23 11:12:44.000000000 +0000
@@ -0,0 +1,1037 @@
+From: Unknown
+Date: Wed, 23 Sep 2020 11:53:26 +0100
+Subject: Import old diff in quilt format
+
+---
+ CREDITS              | 12 ++++++-
+ Configure            |  8 ++---
+ Makefile.cfg.in      |  2 +-
+ RECOMMEND            |  2 +-
+ docs/cfingerd.8      |  2 +-
+ docs/cfingerd.conf.5 | 12 +++----
+ docs/cfingerd.text.5 |  2 +-
+ perl/generic.pl      |  5 +++
+ src/cfingerd.h       |  9 +++---
+ src/fakeuser.c       |  6 ++--
+ src/internal.c       | 10 +++---
+ src/log.c            |  4 +--
+ src/main.c           | 89 +++++++++++++++++++++++++++++++++++++---------------
+ src/parse.c          |  4 +--
+ src/proto.h          |  4 +--
+ src/rfc1413.c        | 61 ++++++++++++++++++++++++++---------
+ src/search.c         | 13 ++------
+ src/signal.c         |  8 ++---
+ src/standard.c       | 35 ++++++++++++++++-----
+ src/userlist.c       | 12 +++----
+ src/util.c           | 11 +++----
+ src/version.c        |  2 +-
+ userlist/display.c   |  4 ++-
+ userlist/idle.c      | 14 ++++++---
+ userlist/userlist.1  |  4 +--
+ 25 files changed, 220 insertions(+), 115 deletions(-)
+
+diff --git a/CREDITS b/CREDITS
+index 6a427f5..5fc7d22 100644
+--- a/CREDITS
++++ b/CREDITS
+@@ -48,7 +48,7 @@ Dan Hollis <root@sasami.anime.net>
+ 	- Shadow password testing
+ 	- Secure (NOBODY PATCH) finger help
+ 
+-cc@spork.neonexus.com
++David Muench <cc@spork.neonexus.com>
+ 	- Finger forwarding idea
+ 
+ Rich Salz <rsalz@uunet.net>
+@@ -76,3 +76,13 @@ Tadek Knapik <tadek@nautilus.uwoj.krakow.pl>
+ 
+ Alexey M. Zelkin <phantom@cris.net>
+ 	- Support for FreeBSD
++
++Kevin Rosenberg <kevin@cyberport.com>
++	- Get UTMP file entries for BSD compatibility
++
++Thomas Koenig <ig25@rz.uni-karlsruhe.de>
++	- Management of e?uid switching
++
++Lars Mathiesen <thorinn@diku.dk>
++	- ABORT code for wildmat
++
+diff --git a/Configure b/Configure
+index befbf91..b3fd8f9 100755
+--- a/Configure
++++ b/Configure
+@@ -17,10 +17,10 @@
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ 
+-require 'perl/question.pl';
+-require 'perl/filemagic.pl';
+-require 'perl/gethost.pl';
+-require 'perl/generic.pl';
++require './perl/question.pl';
++require './perl/filemagic.pl';
++require './perl/gethost.pl';
++require './perl/generic.pl';
+ 
+ $VERSION = "1.4.2";
+ $| = 1;
+diff --git a/Makefile.cfg.in b/Makefile.cfg.in
+index ad0b3bf..033f482 100644
+--- a/Makefile.cfg.in
++++ b/Makefile.cfg.in
+@@ -1,6 +1,6 @@
+ # CFINGERD - Main Makefile configuration
+ #
+-# $Id: Makefile.cfg.in,v 1.4 1999/08/31 00:46:46 joey Exp $
++# $Id: Makefile.cfg.in,v 1.4 1999-08-31 00:46:46 joey Exp $
+ #
+ # Copyright (c) 1999 by Martin Schulze <joey@infodrom.north.de>
+ #
+diff --git a/RECOMMEND b/RECOMMEND
+index bb154da..b467128 100644
+--- a/RECOMMEND
++++ b/RECOMMEND
+@@ -4,7 +4,7 @@ Recommended setups
+ After running cfingerd for quite a while, I have found that if you make 
+ the cfingerd setup the most secure, you will have the least problems.
+ 
+-CFINGERD currently stops all files from being symbolic links, char 
++CFINGERD currently stops for all files from being symbolic links, char 
+ devices, block devices, etc.  Basically, each file has to be a normal 
+ file in order to be read by cfingerd.  With that in mind, you should keep 
+ all files (whether or not they are read by root) as normal files.  This 
+diff --git a/docs/cfingerd.8 b/docs/cfingerd.8
+index e6be05a..d135968 100644
+--- a/docs/cfingerd.8
++++ b/docs/cfingerd.8
+@@ -33,7 +33,7 @@ options, this option is used in inetd.conf, not on the command line.
+ is a totally new, and totally configurable finger daemon \- 
+ one of the first.  It listenes on the finger port (port 79) to provide 
+ useful information about each user that is on your system according to
+-the finger protocol as described in RFC 1228.  Only thing is, cfingerd
++the finger protocol as described in RFC 1288.  Only thing is, cfingerd
+ provides a unique twist.
+ .PP
+ .B CFINGERD
+diff --git a/docs/cfingerd.conf.5 b/docs/cfingerd.conf.5
+index b07388f..bafd83f 100644
+--- a/docs/cfingerd.conf.5
++++ b/docs/cfingerd.conf.5
+@@ -8,8 +8,8 @@ cfingerd.conf \- configurable finger daemon configuration file.
+ .SH DESCRIPTION
+ .I cfingerd.conf
+ is the configuration file for cfingerd.
+-+.I cfingerd
+-+has been totally rewritten
++.B cfingerd
++has been totally rewritten
+ to support a more readable configuration file.  This version of the new 
+ configuration file is
+ .B NOT
+@@ -24,7 +24,7 @@ Each one of those sections is split into subsections, which will be
+ explained next.
+ .PP
+ Subtext of each option is either boolean options, string options, or 
+-switchable options, all changable by the system administrator.
++switchable options, all changeable by the system administrator.
+ .PP
+ Each section is split into a series of sections that resembles C type 
+ definition; not exact, but close enough to be familiar with it.  :)  
+@@ -529,7 +529,7 @@ is the string that is shown when the system gathers information from
+ other sites for a user listing.
+ .br
+ .SH "INTERNAL STRINGS SECTION (CONFIG internal_strings)"
+-These strings are changable, and can be any length you want (within 
++These strings are changeable, and can be any length you want (within 
+ reason).  These strings are concattenated into the syslogging display 
+ when the appropriate finger has been issued.  This section also includes 
+ error messages that may occur.
+@@ -607,9 +607,9 @@ matter.)  These are, instead, treated as normal scripts that can be
+ called for your use.
+ .PP
+ The format is as follows for fake users:
+-.sh
++.br
+     "fake_username", "Script name", SEARCHBOOL, "script"
+-.PP
++.br
+ where...
+ .PP
+ .B fake_username
+diff --git a/docs/cfingerd.text.5 b/docs/cfingerd.text.5
+index 3e6fed1..67f8cdd 100644
+--- a/docs/cfingerd.text.5
++++ b/docs/cfingerd.text.5
+@@ -1,6 +1,6 @@
+ .TH CFINGERD.TEXT 5 "7 Aug 1999" "1.4.2" "Configurable Finger Daemon"
+ .SH NAME
+-cfingerd text rules
++cfingerd.text \- cfingerd text rules
+ .br
+ .SH "EXPLANATION"
+ .B cfingerd
+diff --git a/perl/generic.pl b/perl/generic.pl
+index b5e5d47..4d4f55a 100644
+--- a/perl/generic.pl
++++ b/perl/generic.pl
+@@ -14,6 +14,11 @@ sub get_os {
+ 	chop($uname);
+ 	$uname =~ tr/a-z/A-Z/;
+ 
++	# Tiny hack to make GNU/kFreeBSD and GNU/Hurd act as GNU/Linux
++	if (($uname eq 'GNU/KFREEBSD') || ($uname eq 'GNU')) {
++	    $uname = 'LINUX';
++	}
++
+ 	$ver = `uname -r`;
+ 	chop($ver);
+ 
+diff --git a/src/cfingerd.h b/src/cfingerd.h
+index 9bc5713..97ba635 100644
+--- a/src/cfingerd.h
++++ b/src/cfingerd.h
+@@ -278,10 +278,11 @@ typedef struct ecruft {
+ 
+ extern CONFIG prog_config;
+ extern ECRUFT errors[];
+-extern char *remote_addr, *localhost, *ident_user, *ip_address;
++extern char remote_addr[], ip_address[];
++extern char *localhost, *ident_user;
+ extern int trusted_host_num, rejected_host_num, forward_host_num,
+-	   fakeuser_num, num_finger_sites, num_headers, local_port,
+-	   remote_port, can_log;
++	   fakeuser_num, num_finger_sites, num_headers, can_log;
++extern unsigned short local_port, remote_port;
+ extern FILE *top_display, *bottom_display, *noname_display, *nouser_display,
+ 	    *rejected_display, *identd_display;
+ extern BOOL local_finger, emulated;
+@@ -293,4 +294,4 @@ extern unsigned long listen_addr;
+ 
+ #include "defines.h"
+ 
+-#endif _CFINGERD_H_
++#endif /* _CFINGERD_H_ */
+diff --git a/src/fakeuser.c b/src/fakeuser.c
+index 44be960..80c83c1 100644
+--- a/src/fakeuser.c
++++ b/src/fakeuser.c
+@@ -79,7 +79,7 @@ void handle_fakeuser(char *username)
+ 	    printf("\n                    Sorry, you specified too many options.\n\n");
+ 	    fflush(stdout);
+ 	    show_bottom();
+-	    log(LOG_WARN, "Too many options specified in fake user finger", NULL);
++	    mylog(LOG_WARN, "Too many options specified in fake user finger", NULL);
+ 	    return;
+  	}
+ 
+@@ -105,7 +105,7 @@ void handle_fakeuser(char *username)
+ 	    sscanf(username, "%[^.].%[^.].%[^.].%[^.].%[^\r\n]\r\n",
+ 		data[0], data[1], data[2], data[3], data[4]);
+ 
+-	log(LOG_USER, "Fakeuser: ", username);
++	mylog(LOG_USER, "Fakeuser: ", username);
+ 
+ 	funum = search_fake_pos(data[0]);
+ 
+@@ -133,7 +133,7 @@ void handle_fakeuser(char *username)
+     } else {
+ 	printf("\n");
+ 	printf("             Sorry, this system does not have any fake users enabled!\n\n");
+-	log(LOG_WARN, "Fake user requested, but rejected - disabled.", " ");
++	mylog(LOG_WARN, "Fake user requested, but rejected - disabled.", " ");
+     }
+ 
+     show_bottom();
+diff --git a/src/internal.c b/src/internal.c
+index 1a5d4aa..9056e5e 100644
+--- a/src/internal.c
++++ b/src/internal.c
+@@ -72,26 +72,26 @@ void handle_internal(char *username)
+     else if (!strncmp(username, "services", 8)) {
+ 	show_services();
+ 	syslog(LOG_NOTICE, "%s", prog_config.p_strings[D_SVC_FINGER]);
+-	log(LOG_USER, "Service request", " ");
++	mylog(LOG_USER, "Service request", " ");
+ 	exit(PROGRAM_OKAY);
+     } else if (!strncmp(username, "search", 6)) {
+ 	show_search(username);
+ 	exit(PROGRAM_OKAY);
+     } else if (!strncmp(username, "userlist-only", 13)) {
+-	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist | /usr/bin/tail +2")) != NULL) {
++	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist | /usr/bin/tail -n +2")) != NULL) {
+ 	    printf ("%s", buf);
+ 	    fflush(stdout);
+ 	    free (buf);
+ 	}
+-	log(LOG_USER, "Userlist-only", " ");
++	mylog(LOG_USER, "Userlist-only", " ");
+ 	exit(PROGRAM_OKAY);
+     } else if (!strncmp(username, "userlist-online", 15)) {
+-	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist -c -n | /usr/bin/tail +2")) != NULL) {
++	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist -c -n | /usr/bin/tail -n +2")) != NULL) {
+ 	    printf ("%s", buf);
+ 	    fflush(stdout);
+ 	    free (buf);
+ 	}
+-	log(LOG_USER, "Userlist-only", " ");
++	mylog(LOG_USER, "Userlist-only", " ");
+ 	exit(PROGRAM_OKAY);
+     } else if (!strncmp(username, "help", 4)) {
+ 	show_top();
+diff --git a/src/log.c b/src/log.c
+index 7939c7d..b397d20 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -17,7 +17,7 @@
+ #include "proto.h"
+ #include "privs.h"
+ 
+-void log(int logtype, char *msg, char *user)
++void mylog(int logtype, char *msg, char *user)
+ {
+     if (can_log && (prog_config.config_bits3 & SHOW_LOG)) {
+ 	time_t tim = time(NULL);
+@@ -80,7 +80,7 @@ void userlog(uid_t uid, gid_t gid, char *dir, char *user)
+     } else {
+ 	if (!(prog_config.config_bits3 & SHOW_CREATE_FLG)) {
+ 	    syslog(LOG_WARNING, "Userlog: %s (%s)", filename, strerror(errno));
+-	    log(LOG_ERROR, "Cannot write to userlog: ", strerror(errno));
++	    mylog(LOG_ERROR, "Cannot write to userlog: ", strerror(errno));
+ 	}
+     }
+ }
+diff --git a/src/main.c b/src/main.c
+index f6a7a71..d300e8c 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -20,11 +20,13 @@
+ #include "privs.h"
+ 
+ CONFIG prog_config;
+-char *remote_addr, *localhost, *ident_user, *ip_address;
++char *localhost, *ident_user;
++char ip_address[INET6_ADDRSTRLEN] = "";
++char remote_addr[INET6_ADDRSTRLEN] = "";
+ FILE *top_display, *bottom_display, *noname_display, *nouser_display,
+      *rejected_display, *identd_display;
+ BOOL local_finger, emulated; 
+-int local_port, remote_port;
++unsigned short local_port, remote_port;
+ unsigned short listen_port;
+ unsigned long listen_addr;
+ 
+@@ -62,14 +64,15 @@ int main(int argc, char *argv[])
+     char line[100], username[80], syslog_str[200];
+     int un_type;
+     char *cp;
+-    struct sockaddr_in local_addr;
++    struct sockaddr_storage local_addr;
++    struct sockaddr_in *sloc4 = (struct sockaddr_in *) &local_addr;
++    struct sockaddr_in6 *sloc6 = (struct sockaddr_in6 *) &local_addr;
+     struct servent *serv;
+ 
+     if ((serv = getservbyname("finger","tcp")) != NULL)
+ 	listen_port = serv->s_port;
+     else
+ 	listen_port = htons(79);
+-    listen_addr = htonl(INADDR_ANY);
+ 
+     /* Initialize CFINGERD */
+     start_handler();
+@@ -108,12 +111,12 @@ int main(int argc, char *argv[])
+     /* Make sure there is actually data waiting in the finger port */
+     if (!emulated) {
+ 	if (!fgets(username, sizeof(username), stdin)) {
+-	  if (remote_addr != NULL) {
++	  if (remote_addr != NULL && *remote_addr) {
+ 	    syslog(LOG_ERR, "Null query from %s: %m", remote_addr);
+-	    log(LOG_ERROR, remote_addr, strerror(errno));
++	    mylog(LOG_ERROR, remote_addr, strerror(errno));
+ 	  } else {
+ 	    syslog(LOG_ERR, "Null query: %m");
+-	    log(LOG_ERROR, strerror(errno), strerror(0));
++	    mylog(LOG_ERROR, strerror(errno), strerror(0));
+ 	  }
+ 	    closelog();
+ 	    exit(PROGRAM_SYSLOG);
+@@ -147,33 +150,64 @@ int main(int argc, char *argv[])
+     /* If we're not doing emulated stuff, we can assume that we are running
+        either as a daemon, or under INETD.  In that case... */
+     if (!emulated) {
+-	struct sockaddr_in socket_addr;
++	struct sockaddr_storage socket_addr;
++	struct sockaddr_in *srem4 = (struct sockaddr_in *) &socket_addr;
++	struct sockaddr_in6 *srem6 = (struct sockaddr_in6 *) &socket_addr;
+ 	struct hostent *host_ent;
+-	int psize = 0;
++	socklen_t locsize = 0, remsize = 0;
+ 
+ 	/* Can't run from command line (but this should already be checked) */
+-	psize = sizeof(socket_addr);
++	locsize = sizeof(local_addr);
+ 
+-	if (getsockname(0, (struct sockaddr *) &local_addr, &psize)) {
++	if (getsockname(0, (struct sockaddr *) &local_addr, &locsize)) {
+ 	    syslog(LOG_WARNING, "getsockname: %s", strerror(errno));
+ 	    local_port = 0;
+ 	} else
+-	    local_port = ntohs(local_addr.sin_port);
++	    switch (local_addr.ss_family) {
++		case AF_INET6:
++		    local_port = ntohs(sloc6->sin6_port);
++		    break;
++		case AF_INET:
++		default:
++		    local_port = ntohs(sloc4->sin_port);
++	    }
++
++	remsize = sizeof(socket_addr);
+ 
+-	if (getpeername(0, (struct sockaddr *) &socket_addr, &psize)) {
++	if (getpeername(0, (struct sockaddr *) &socket_addr, &remsize)) {
+ 	    printf("Internal error - not running as either a daemon or under INETD.\n");
+ 	    printf("Fatal - getpeername: %s\n", strerror(errno));
+ 	    closelog();
+-	    log(LOG_ERROR, "getpeername: ", strerror(errno));
++	    mylog(LOG_ERROR, "getpeername: ", strerror(errno));
+ 	    exit(PROGRAM_BUG);
+ 	} else
+-	    remote_port = ntohs(socket_addr.sin_port);
++	    switch (socket_addr.ss_family) {
++		case AF_INET6:
++		    remote_port = ntohs(srem6->sin6_port);
++		    break;
++		case AF_INET:
++		default:
++		    remote_port = ntohs(srem4->sin_port);
++	    }
+ 
+-	ip_address = inet_ntoa (socket_addr.sin_addr);
++	inet_ntop(socket_addr.ss_family, &socket_addr,
++			ip_address, INET6_ADDRSTRLEN);
+ 
+ 	/* Get our host entry */
+-	host_ent = (struct hostent *) gethostbyaddr((char *) &socket_addr.sin_addr,
+-		   sizeof(socket_addr.sin_addr), AF_INET);
++	switch (socket_addr.ss_family) {
++	    case AF_INET6:
++		host_ent = (struct hostent *)
++				gethostbyaddr((char *) &srem6->sin6_addr,
++					sizeof(struct in6_addr),
++					socket_addr.ss_family);
++		break;
++	    case AF_INET:
++	    default:
++		host_ent = (struct hostent *)
++				gethostbyaddr((char *) &srem4->sin_addr,
++					sizeof(struct in_addr),
++					socket_addr.ss_family);
++	}
+ 
+ 	/* And get our local-host name */
+ #ifndef	ACTUAL_HOSTNAME
+@@ -184,14 +218,14 @@ int main(int argc, char *argv[])
+ 
+ 	/* Make sure we can get the remote host's address name */
+ 	if (host_ent == NULL) {
+-	    remote_addr = inettos(socket_addr.sin_addr.s_addr);
++	    strncpy(remote_addr, ip_address, INET6_ADDRSTRLEN);
+ 	    syslog(LOG_WARNING, "%s %s", 
+ 		prog_config.p_strings[D_IP_NO_MATCH],
+ 		remote_addr);
+ 	    if (!(prog_config.config_bits2 & SHOW_IP_MATCH))
+ 		CF_ERROR(E_NOIP);
+ 	} else
+-	    remote_addr = (char *) host_ent->h_name;
++	    strncpy(remote_addr, host_ent->h_name, INET6_ADDRSTRLEN);
+ 
+ 	/* Convert any uppercase letters in the hostname to lowercase */
+ 	for (cp = remote_addr; *cp; cp++)
+@@ -200,14 +234,17 @@ int main(int argc, char *argv[])
+ 
+ 	/* And find out if this is a local finger */
+ 	if (!strncasecmp(remote_addr, "127.0.0.1", 9) ||
++	    !strncasecmp(remote_addr, "::1", 3) ||
+ 	    !strncasecmp(remote_addr, "localhost", 9) ||
++	    !strncasecmp(remote_addr, "ip6-localhost", 9) ||
++	    !strncasecmp(remote_addr, "ip6-loopback", 9) ||
+ 	    !strncasecmp(remote_addr, "127.0.0.0", 9) || /* KTH 07/26/96 */
+ 	    !strncasecmp(remote_addr, localhost, strlen(localhost)))
+ 	    local_finger = TRUE;
+ 	else
+ 	    local_finger = FALSE;
+ 
+-	ident_user = get_rfc1413_data(local_addr);
++	ident_user = get_rfc1413_data(&local_addr, &socket_addr);
+ 	set_time_format();
+ 
+     } else
+@@ -220,9 +257,9 @@ int main(int argc, char *argv[])
+ 	memset (ident_user, 0, sizeof (ident_user));
+ 	strcpy (ident_user, "emulated");
+ #ifndef	ACTUAL_LOOPBACK
+-	remote_addr = "127.0.0.1";
++	strcpy(remote_addr,"127.0.0.1");
+ #else
+-	remote_addr = ACTUAL_LOOPBACK;
++	strcpy(remote_addr, ACTUAL_LOOPBACK);
+ #endif
+     }
+ 
+@@ -242,7 +279,7 @@ int main(int argc, char *argv[])
+ 	    if (!emulated) {
+ 		snprintf(syslog_str, sizeof(syslog_str), "%s fingered (internal) from %s", username,
+ 		    ident_user);
+-		syslog(LOG_NOTICE, (char *) syslog_str);
++		syslog(LOG_NOTICE, "%s", (char *) syslog_str);
+ 	    }
+ 
+ 	    handle_internal(username);
+@@ -255,7 +292,7 @@ int main(int argc, char *argv[])
+ 		    snprintf(syslog_str, sizeof(syslog_str), "%s fingered from %s",
+ 			prog_config.p_strings[D_ROOT_FINGER], ident_user);
+ 
+-		syslog(LOG_NOTICE, (char *) syslog_str);
++		syslog(LOG_NOTICE, "%s", (char *) syslog_str);
+ 	    }
+ 
+ 	    handle_standard(username);
+@@ -265,7 +302,7 @@ int main(int argc, char *argv[])
+ 		snprintf(syslog_str, sizeof(syslog_str), "%s %s from %s", username, 
+ 		    prog_config.p_strings[D_FAKE_USER], ident_user);
+ 
+-		syslog(LOG_NOTICE, (char *) syslog_str);
++		syslog(LOG_NOTICE, "%s", (char *) syslog_str);
+ 	    }
+ 
+ 	    handle_fakeuser(username);
+diff --git a/src/parse.c b/src/parse.c
+index 9c7ad87..96a3abc 100644
+--- a/src/parse.c
++++ b/src/parse.c
+@@ -137,14 +137,14 @@ int process_username(char *username)
+ 	if (ret == U_FORWARD) {
+ 	    printf("%s\n", prog_config.p_strings[D_FORWARD_DENY]);
+ 	    fflush(stdout);
+-	    log(LOG_USER, "Denied forward: ", username);
++	    mylog(LOG_USER, "Denied forward: ", username);
+ 	    exit(1);
+ 	}
+ 
+ 	if (ret == U_ILLEGAL) {
+ 	    printf("Illegal character in username.\n");
+ 	    fflush(stdout);
+-	    log(LOG_USER, "Illegal: ", username);
++	    mylog(LOG_USER, "Illegal: ", username);
+ 	    exit(1);
+ 	}
+ 
+diff --git a/src/proto.h b/src/proto.h
+index 9d48c99..789b21f 100644
+--- a/src/proto.h
++++ b/src/proto.h
+@@ -45,9 +45,9 @@ void show_search(char *);
+ void become_nobody(void);
+ void become_user(char *);
+ int wildmat(char *, char *);
+-char *get_rfc1413_data(struct sockaddr_in );
++char *get_rfc1413_data(struct sockaddr_storage *, struct sockaddr_storage *);
+ void check_unknown(char *);
+-void log(int, char *, char *);
++void mylog(int, char *, char *);
+ void userlog(uid_t, gid_t, char *, char *);
+ void check_blank_configurations(void);
+ int search_fake_pos(char *);
+diff --git a/src/rfc1413.c b/src/rfc1413.c
+index 05a395a..8ee02de 100644
+--- a/src/rfc1413.c
++++ b/src/rfc1413.c
+@@ -25,45 +25,75 @@ void rfc1413_alarm(int signal)
+  * the implementation.  Completely rewritten by yours truly to be self-
+  * contained in a single program.  Simple, easy to use.
+  */
+-#define BUFLEN	256
+-char *get_rfc1413_data( struct sockaddr_in local_addr )
++#define UNAMELEN   64
++#define BUFLEN     UNAMELEN + INET6_ADDRSTRLEN + 2
++#define INPUTLEN   256
++char *get_rfc1413_data(struct sockaddr_storage * local_addr,
++			struct sockaddr_storage * peer_addr )
+ {
+     int i, j;
+-    struct sockaddr_in sin;
+-    char buffer[1024], buf[BUFLEN], uname[64], *bleah;
++    unsigned short newport;
++    struct sockaddr_storage sin;
++    struct sockaddr_in *sa4 = (struct sockaddr_in *) &sin;
++    struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &sin;
++    char buffer[1024], buf[INPUTLEN], uname[UNAMELEN], *bleah;
+     char *cp, *xp;
+     struct servent *serv;
+ 
+     bleah = (char *) malloc(BUFLEN);
+     memset(bleah, 0, BUFLEN);
+ 
+-    j = socket(AF_INET, SOCK_STREAM, 0);
++    j = socket(local_addr->ss_family, SOCK_STREAM, 0);
+     if (j < 2) {
+ 	snprintf(bleah, BUFLEN, "unknown@%s", remote_addr);
+ 	syslog(LOG_ERR, "rfc1413-socket: %s", strerror(errno));
+ 	return(bleah);
+     }
+ 
+-    sin.sin_family = AF_INET;
+-    sin.sin_addr.s_addr = local_addr.sin_addr.s_addr;
+-    sin.sin_port = 0;
+-    i = bind(j, (struct sockaddr *) &sin, sizeof(sin));
++    memcpy(&sin, local_addr, sizeof(sin));
++    switch (sin.ss_family) {
++	case AF_INET6:
++	    sa6->sin6_port = 0;
++	    break;
++	case AF_INET:
++	default:
++	    sa4->sin_port = 0;
++    }
++
++    i = bind(j, (struct sockaddr *) &sin, 
++		    (sin.ss_family == AF_INET6 )
++			? sizeof(struct sockaddr_in6)
++			: sizeof(struct sockaddr_in));
++
+     if (i < 0) {
+ 	snprintf(bleah, BUFLEN, "unknown@%s", remote_addr);
+ 	syslog(LOG_ERR, "rfc1413-socket: %s", strerror(errno));
+ 	return(bleah);
+     }
+ 
+-    sin.sin_family = AF_INET;
+     if ((serv = getservbyname("auth","tcp")) != NULL)
+-	sin.sin_port = serv->s_port;
++	newport = serv->s_port;
+     else
+-	sin.sin_port = htons(113);
+-    sin.sin_addr.s_addr = inet_addr(ip_address);
++	newport = htons(113);
++
++    memcpy(&sin, peer_addr, sizeof(sin));
++    switch (sin.ss_family) {
++	case AF_INET6:
++	    sa6->sin6_port = newport;
++	    break;
++	case AF_INET:
++	default:
++	    sa4->sin_port = newport;
++    }
++
+     signal(SIGALRM, rfc1413_alarm);
+     alarm(5);
+ 
+-    i = connect(j, (struct sockaddr *) &sin, sizeof(sin));
++    i = connect(j, (struct sockaddr *) &sin,
++		    (sin.ss_family == AF_INET6 )
++			? sizeof(struct sockaddr_in6)
++			: sizeof(struct sockaddr_in));
++
+     if (i < 0) {
+ 	syslog(LOG_ERR, "rfc1413-connect: %s", strerror(errno));
+ 	close(j);
+@@ -98,7 +128,8 @@ char *get_rfc1413_data( struct sockaddr_in local_addr )
+ 
+ 	if (*(++cp) == ' ') cp++;
+ 	memset(uname, 0, sizeof(uname));
+-	for (xp=uname; *cp != '\0' && *cp!='\r'&&*cp!='\n'&&strlen(uname)<sizeof(uname); cp++)
++	for (xp=uname; *cp != '\0' && *cp!='\r'&&*cp!='\r'&&*cp!='\n'&&(strlen(uname)+1)<sizeof(uname); cp++)
++
+ 	    *(xp++) = *cp;
+ 
+ 	if (!strlen(uname)) {
+diff --git a/src/search.c b/src/search.c
+index 3523517..de1d950 100644
+--- a/src/search.c
++++ b/src/search.c
+@@ -36,7 +36,7 @@ void show_search(char *uname)
+     SEARCHLIST searches[MAX_SEARCHES];
+     FILE *file;
+     char *cp;
+-    char *xp, y;
++    char *xp;
+ 
+     show_top();
+ 
+@@ -56,13 +56,6 @@ void show_search(char *uname)
+ 	exit(PROGRAM_OKAY);
+     }
+ 
+-    for (cp=searchname,xp=searchname,y=0;*cp;cp++) {
+-	if (y != *cp)
+-	    *(xp++) = *cp;
+-	y = *cp;
+-    }
+-    *xp = '\0';
+-	
+     if (strlen((char *) searchname) == 0) {
+ 	printf("\n                    You must supply a name to search for!\n");
+ 	SEND_RAW_RETURN;
+@@ -75,7 +68,7 @@ void show_search(char *uname)
+ 	printf("\n                    You must supply a name to search for!\n");
+ 	SEND_RAW_RETURN;
+ 	show_bottom();
+-	log(LOG_USER, "Security breach: finger * from %s", ident_user);
++	mylog(LOG_USER, "Security breach: finger * from %s", ident_user);
+ 	syslog(LOG_WARNING, "Security breach: finger * from %s", ident_user);
+ 	free (searchname);
+ 	exit(PROGRAM_OKAY);
+@@ -85,7 +78,7 @@ void show_search(char *uname)
+       if (isupper(*cp))
+ 	*cp = tolower(*cp);
+ 
+-    log(LOG_USER, "Search: ", searchname);
++    mylog(LOG_USER, "Search: ", searchname);
+ 
+     NOBODY_PRIVS;
+ 
+diff --git a/src/signal.c b/src/signal.c
+index 162952d..23d366c 100644
+--- a/src/signal.c
++++ b/src/signal.c
+@@ -81,7 +81,7 @@ void int_handler(int signo)
+ 
+ 	    if (siglist[i].fatal) {
+ 		printf("\nPlease report this bug to %s!\n", ERRORS_TO);
+-		log(LOG_ERROR, "Signal (fatal): ", siglist[i].sigtype);
++		mylog(LOG_ERROR, "Signal (fatal): ", siglist[i].sigtype);
+ 	    } else {
+ 		if (siglist[i].value == SIGALRM) {
+ 		    printf("Ooh, you caught an alarm signal.  This may be a cause from either not\n");
+@@ -89,7 +89,7 @@ void int_handler(int signo)
+ 		    printf("out on you.  May want to check this.  :)\n\n");
+ 		}
+ 
+-		log(LOG_WARN, "Signal: Alarm signal", " ");
++		mylog(LOG_WARN, "Signal: Alarm signal", " ");
+ 
+ 		printf("Non-fatal; continuing.\n");
+ 	    }
+@@ -99,7 +99,7 @@ void int_handler(int signo)
+ 	    if (siglist[i].fatal)
+ 		exit(PROGRAM_BUG);
+ 	    else
+-		log(LOG_WARN, "Signal (non-fatal): ", siglist[i].sigtype);
++		mylog(LOG_WARN, "Signal (non-fatal): ", siglist[i].sigtype);
+ 	}
+     }
+ 
+@@ -109,7 +109,7 @@ void int_handler(int signo)
+ 	syslog(LOG_ERR, "SIGUNKNOWN caught");
+ 	(void) fflush(stdout);
+ 
+-	log(LOG_ERROR, "Signal: Unknown signal", " ");
++	mylog(LOG_ERROR, "Signal: Unknown signal", " ");
+ 
+ 	exit(PROGRAM_BUG);
+     }
+diff --git a/src/standard.c b/src/standard.c
+index 655c1e3..b4ba433 100644
+--- a/src/standard.c
++++ b/src/standard.c
+@@ -155,6 +155,7 @@ void show_pfile(uid_t uid, gid_t gid, int t1, int t2, int t3, char *dir, char *d
+ 	    fflush(stdout);
+ 	}
+ 
++	USER_PRIVS(uid, gid);
+ 	if (exist(d)) {
+ 	    NOBODY_PRIVS;
+ 
+@@ -163,9 +164,14 @@ void show_pfile(uid_t uid, gid_t gid, int t1, int t2, int t3, char *dir, char *d
+ 		fflush(stdout);
+ 	    }
+ 
++	    USER_PRIVS(uid, gid);
+ 	    if ((file = open_file(d)) != NULL)
++	    {
++		NOBODY_PRIVS;
+ 		display_file(uid, gid, file);
++           }
+ 	} else {
++	    NOBODY_PRIVS;
+ 	    if (!(prog_config.config_bits3 & SHOW_HEADERS_FE))
+ 		printf("%s\n", prog_config.p_strings[t3]);
+ 	    else
+@@ -206,6 +212,7 @@ void show_pfile2(uid_t uid, gid_t gid, int t1, int t2, int t3, char *dir, char *
+ 	    fflush(stdout);
+ 	}
+ 
++	USER_PRIVS(uid, gid);
+ 	if (exist(d)) {
+ 	    NOBODY_PRIVS;
+ 
+@@ -214,9 +221,13 @@ void show_pfile2(uid_t uid, gid_t gid, int t1, int t2, int t3, char *dir, char *
+ 		fflush(stdout);
+ 	    }
+ 
+-	    if ((open_file (d)) != NULL)
++	    USER_PRIVS(uid, gid);
++	    if ((file = open_file (d)) != NULL) {
++		NOBODY_PRIVS;
+ 		display_file(uid, gid, file);
++           }
+ 	} else {
++	    NOBODY_PRIVS;
+ 	    if (!(prog_config.config_bits3 & SHOW_HEADERS_FE))
+ 		printf("%s\n", prog_config.p_strings[t3]);
+ 	}
+@@ -376,11 +387,21 @@ void show_idle(char *tty)
+     sprintf(dev_file, "/dev/%s", tty);
+ 
+     USER_PRIVS(nuid, ngid);
+-    stat((char *) dev_file, &buf);
++    if (stat((char *) dev_file, &buf) != 0) {
++	NOBODY_PRIVS;
++	return;
++    }
+     NOBODY_PRIVS;
+ 
++    if (!buf.st_atime || !buf.st_mtime)
++	return;
++
+     cur_time = time(NULL);
+-    diff_time = (long) cur_time - (long) buf.st_mtime;
++    diff_time = buf.st_mtime < buf.st_atime
++		? (long) cur_time - (long) buf.st_mtime
++		: (long) cur_time - (long) buf.st_atime;
++    if (diff_time < 0)
++	diff_time = 0;
+ 
+     sec = min = hour = day = has = 0;
+ 
+@@ -394,7 +415,7 @@ void show_idle(char *tty)
+ 	sec = has = 1;
+ 
+     if (has)
+-	printf(" Idle ");
++	printf(" idle ");
+ 
+     if (day) {
+ 	day = diff_time / 86400;
+@@ -1002,21 +1023,21 @@ void handle_standard(char *username)
+ 		memset(uname, 0, 600);
+ 		printf("\nChecking site %s for the specified user.\n", prog_config.forward[nums]);
+ 		fflush(stdout);
+-		snprintf(uname, sizeof(uname), "/usr/bin/finger \"%s\100%s\" | /usr/bin/tail +2", username, prog_config.forward[nums]);
++		snprintf(uname, sizeof(uname), "/usr/bin/finger \"%s\100%s\" | /usr/bin/tail -n +2", username, prog_config.forward[nums]);
+ 		if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, uname)) != NULL) {
+ 		    printf ("%s", buf);
+ 		    fflush(stdout);
+ 		    free (buf);
+ 		}
+ 		nums++;
+-		log(LOG_USER, "Forwarded: ", username);
++		mylog(LOG_USER, "Forwarded: ", username);
+ 	    }
+ 	} else {
+ 	    show_notexist();
+ 	}
+     } else {
+ 	show_fingerinfo(username);
+-	log(LOG_USER, "Normal: ", username);
++	mylog(LOG_USER, "Normal: ", username);
+     }
+ 
+     if ((!(prog_config.config_bits2 & SHOW_FINGERFWD)) || 
+diff --git a/src/userlist.c b/src/userlist.c
+index 8058b0e..c049925 100644
+--- a/src/userlist.c
++++ b/src/userlist.c
+@@ -56,10 +56,10 @@ void handle_userlist(char *username)
+ 
+ 		    if (!strcmp (username, "userlist"))
+ 			snprintf(cmdline, sizeof (cmdline),
+-				 "%s -n | /usr/bin/tail +2", prog_config.finger_program);
++				 "%s -n | /usr/bin/tail -n +2", prog_config.finger_program);
+ 		    else
+ 			snprintf(cmdline, sizeof (cmdline),
+-				 "%s | /usr/bin/tail +2", prog_config.finger_program);
++				 "%s | /usr/bin/tail -n +2", prog_config.finger_program);
+ 
+ 		    if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, cmdline)) != NULL) {
+ 			if (!head) {
+@@ -72,10 +72,10 @@ void handle_userlist(char *username)
+ 		    }
+ 		} else {
+ 		    if (!strcmp (username, "userlist"))
+-			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-online@%s | tail +2 | grep -v '^$'",
++			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-online@%s | tail -n +2 | grep -v '^$'",
+ 				 prog_config.finger_sites[i]);
+ 		    else
+-			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-only@%s | tail +2 | grep -v '^$'",
++			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-only@%s | tail -n +2 | grep -v '^$'",
+ 				 prog_config.finger_sites[i]);
+ 
+ 		    if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, cmdline)) != NULL) {
+@@ -92,7 +92,7 @@ void handle_userlist(char *username)
+ 	} else {
+ 	    if ((!strstr(prog_config.finger_program, "finger")) &&
+ 		(!strstr(prog_config.finger_program, "w")))
+-		snprintf(cmdline, sizeof(cmdline), "%s | /usr/bin/tail +2", prog_config.finger_program);
++		snprintf(cmdline, sizeof(cmdline), "%s | /usr/bin/tail -n +2", prog_config.finger_program);
+ 	    else 
+ 		snprintf(cmdline, sizeof(cmdline), "%s", prog_config.finger_program);
+ 
+@@ -144,7 +144,7 @@ void handle_userlist(char *username)
+ 
+     show_bottom();
+ 
+-    log(LOG_USER, "Userlist request", " ");
++    mylog(LOG_USER, "Userlist request", " ");
+ }
+ 
+ /*
+diff --git a/src/util.c b/src/util.c
+index 770ad0a..76a1819 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -178,7 +178,7 @@ void parse_line(uid_t uid, gid_t gid, char *line)
+ 
+ 	    pos++;
+ 
+-	    while((line[pos] != ' ') && (!done)) {
++	    while (line[pos] != ' ' && !done && newpos < 80) {
+ 		command[newpos] = line[pos];
+ 
+ 		if (line[pos] == ' ')
+@@ -298,7 +298,7 @@ void parse_line(uid_t uid, gid_t gid, char *line)
+ 	    for(x = 0; x < center_dist; x++)
+ 		printf(" ");
+ 
+-	printf(displine);
++	printf("%s", displine);
+ 
+ 	free(displine);
+     }
+@@ -465,7 +465,7 @@ char *get_localhost(void)
+     ret = (char *) malloc(strlen((char *) hostname) +
+ 			  strlen((char *) domname) + 2);
+ 
+-    snprintf(ret, sizeof(ret), "%s.%s", (char *) hostname, (char *) domname);
++    sprintf(ret, "%s.%s", (char *) hostname, (char *) domname);
+     return(ret);
+ }
+ 
+@@ -483,7 +483,7 @@ void check_unknown(char *host)
+ 	    host, prog_config.p_strings[D_REJECT_HOST]);
+ 	if (prog_config.config_bits2 & SHOW_REJECTED)
+ 	    display_file(NOBODY_UID, NOBODY_GID, rejected_display);
+-	log(LOG_IDENT, "Unknown not allowed from ", host);
++	mylog(LOG_IDENT, "Unknown not allowed from ", host);
+ 
+ 	exit(PROGRAM_OKAY);
+     }
+@@ -537,7 +537,7 @@ void check_rejected(char *host)
+ 	    if (prog_config.config_bits2 & SHOW_REJECTED)
+ 		display_file(NOBODY_UID, NOBODY_GID, rejected_display);
+ 
+-	    log(LOG_REJECTED, "Rejected host finger detected to ", host);
++	    mylog(LOG_REJECTED, "Rejected host finger detected to ", host);
+ 
+ 	    exit(PROGRAM_OKAY);
+ 	}
+@@ -588,7 +588,6 @@ char *safe_exec (uid_t uid, gid_t gid, char *cmd)
+ 	memset (line, 0, 600);
+ 	while ((read (fd[0], line, sizeof (line)-1)) > 0) {
+ 	    if ((size += strlen (line)) < MAX_POPEN_BUF) {
+-		syslog (LOG_INFO, "Reallocating %d bytes", size);
+ 		if ((result = (char *) realloc (result, size+1)) == NULL) {
+ 		    return NULL;
+ 		}
+diff --git a/src/version.c b/src/version.c
+index 1a1c8a9..30e757c 100644
+--- a/src/version.c
++++ b/src/version.c
+@@ -45,7 +45,7 @@ void show_version_info(void)
+     printf("The last stable version of CFINGERD is %s\n\n", LAST_STABLE_RELEASE);
+ #endif
+ 
+-    log(LOG_USER, "Version information", " ");
++    mylog(LOG_USER, "Version information", " ");
+ 
+     fflush(stdout);
+     exit(PROGRAM_OKAY);
+diff --git a/userlist/display.c b/userlist/display.c
+index 5907dff..3c0a97c 100644
+--- a/userlist/display.c
++++ b/userlist/display.c
+@@ -79,7 +79,7 @@ void process_display(void)
+ 
+ 	if (strlen((char *) tty_list[i].username) > 1) {
+ 	    char *username=NULL;
+-	    char ru[8], fn[STRLEN];
++	    char ru[9], fn[STRLEN];
+ 
+ 	    memset(ru, 0, sizeof (ru));
+ 	    memset(fn, 0, sizeof (fn));
+@@ -89,6 +89,8 @@ void process_display(void)
+ 	    pwent = getpwnam((char *) ru);
+ 
+ 	    if (pwent) {
++		char *cp, *x;
++
+ 		cp = pwent->pw_gecos;
+ 		if ((x = index (pwent->pw_gecos, ',')) != NULL) /* username */
+ 		    *x = '\0';
+diff --git a/userlist/idle.c b/userlist/idle.c
+index 829dea7..cec0c5f 100644
+--- a/userlist/idle.c
++++ b/userlist/idle.c
+@@ -24,10 +24,16 @@ char *calc_idle(char *tty)
+ 
+     snprintf(dev_file, sizeof (dev_file), "/dev/%s", tty);
+ 
+-    stat((char *) dev_file, &buf);
++    if (stat((char *) dev_file, &buf) != 0 || !buf.st_atime || !buf.st_mtime) {
++	sprintf(idledisp, "-");
++	return idledisp;
++    }
+     cur_time = time(NULL);
+-
+-    diff_time = (long) cur_time - (long) buf.st_mtime;
++    diff_time = buf.st_mtime < buf.st_atime
++		? (long) cur_time - (long) buf.st_mtime
++		: (long) cur_time - (long) buf.st_atime;
++    if (diff_time < 0)
++	diff_time = 0;
+ 
+     min = hour = day = 0;
+ 
+@@ -45,7 +51,7 @@ char *calc_idle(char *tty)
+ 
+     if (day) {
+ 	if (no_idle) return NULL;
+-	snprintf(idledisp, sizeof (idledisp), "%1dd ", day);
++	snprintf(idledisp, sizeof (idledisp), "%1dd", day);
+ 	return idledisp;
+     }
+ 
+diff --git a/userlist/userlist.1 b/userlist/userlist.1
+index 35c9b6f..a50a29f 100644
+--- a/userlist/userlist.1
++++ b/userlist/userlist.1
+@@ -8,7 +8,7 @@ userlist \- Userlisting of who's on your system.
+ .SH DESCRIPTION
+ This program simply gives you a listing of who is connected to your 
+ system.  It is used primarily in the sorted listing of
+-.Br cfingerd ,
++.BR cfingerd ,
+ which 
+ utilitizes the same method of display for a more uniform output between 
+ systems.  (It also made more sense to do it this way instead of having 
+@@ -40,7 +40,7 @@ it checks getpwnam, anyway.  :)
+ .B "\-c"
+ Give standard CFINGERD (custom) output.
+ .TP
+-.B. "\-n"
++.B "\-n"
+ List only people idle less than one day.
+ .br
+ .SH ADDITIONAL
diff -pruN 1.4.3-3.2/debian/patches/reproducible-build.patch 1.4.3-5/debian/patches/reproducible-build.patch
--- 1.4.3-3.2/debian/patches/reproducible-build.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1.4.3-5/debian/patches/reproducible-build.patch	2020-09-23 11:12:44.000000000 +0000
@@ -0,0 +1,30 @@
+From: Chris Lamb <lamby@debian.org>
+Date: Wed, 23 Sep 2020 12:08:17 +0100
+Subject: Make the build reproducible
+
+---
+ Configure | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Configure b/Configure
+index b3fd8f9..3ccc4cc 100755
+--- a/Configure
++++ b/Configure
+@@ -17,6 +17,8 @@
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ 
++use POSIX qw(strftime);
++
+ require './perl/question.pl';
+ require './perl/filemagic.pl';
+ require './perl/gethost.pl';
+@@ -63,7 +65,7 @@ sub make_config {
+ 	print "Creating src/config.h ... ";
+ 
+ 	$ENV{'LC_TIME'} = "C";
+-	local($dateandtime) = `date`;
++	local($dateandtime) = strftime("%a %b %e %H:%M:%S UTC %Y", gmtime($ENV{SOURCE_DATE_EPOCH} || time));
+ 	chop($dateandtime);
+ 
+ 	open(CF, "src/config.h.in");
diff -pruN 1.4.3-3.2/debian/patches/series 1.4.3-5/debian/patches/series
--- 1.4.3-3.2/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ 1.4.3-5/debian/patches/series	2020-09-23 11:12:44.000000000 +0000
@@ -0,0 +1,3 @@
+import_diff.patch
+fix_ftbfs.patch
+reproducible-build.patch
diff -pruN 1.4.3-3.2/debian/rules 1.4.3-5/debian/rules
--- 1.4.3-3.2/debian/rules	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/debian/rules	2020-09-23 11:12:44.000000000 +0000
@@ -19,10 +19,7 @@ SHELL=/bin/bash
 
 # The name and version of the source
 #
-source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g')
 package = $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g')
-version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g')
-revision = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g')
 
 installbin = install -g root -o root -m 755
 installdoc = install -g root -o root -m 644
@@ -32,15 +29,12 @@ CFLAGS = -g -O2 -Wall
 else
 CFLAGS = -O2 -Wall
 endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-STRIP = -s
-endif
 
 build:
 	-test -f Makefile.cfg || ./Configure -c config=/etc/cfingerd/cfingerd.conf \
 		-c mandir=/usr/share/man -c man_owner=root -c man_group=root \
 		-c cflags="$(CFLAGS)"
-	$(MAKE) all
+	dh_auto_build -- all
 	touch stamp-build
 
 clean: debclean
@@ -69,8 +63,8 @@ binary-arch: debclean
 	$(installdoc) CREDITS FAQ RECOMMEND TODO debian/tmp/usr/share/doc/$(package)
 	$(installdoc) CHANGES debian/tmp/usr/share/doc/$(package)/changelog
 	$(installdoc) README debian/tmp/usr/share/doc/$(package)/readme
-	gzip -9f debian/tmp/usr/share/doc/$(package)/{changelog.Debian,changelog}
-	gzip -9f debian/tmp/usr/share/doc/$(package)/{readme,CREDITS,FAQ,RECOMMEND,TODO}
+	gzip -9nf debian/tmp/usr/share/doc/$(package)/{changelog.Debian,changelog}
+	gzip -9nf debian/tmp/usr/share/doc/$(package)/{readme,CREDITS,FAQ,RECOMMEND,TODO}
 	#
 	$(installbin) -d debian/tmp/usr/sbin
 	$(installbin) $(STRIP) src/cfingerd debian/tmp/usr/sbin
@@ -79,7 +73,7 @@ binary-arch: debclean
 	$(installbin) -d debian/tmp/usr/share/man/man{5,8}
 	cd docs && $(MAKE) MANDIR=../debian/tmp/usr/share/man install
 	$(installdoc) userlist/userlist.1 debian/tmp/usr/share/man/man8/userlist.8
-	gzip -9 debian/tmp/usr/share/man/man?/*
+	gzip -9n debian/tmp/usr/share/man/man?/*
 	#
 	$(installbin) -d debian/tmp/etc/cfingerd{,/scripts}
 	$(installdoc) debian/{top_finger,bottom_finger}.txt debian/tmp/etc/cfingerd
@@ -106,26 +100,8 @@ binary-arch: debclean
 
 binary: binary-indep binary-arch
 
-source diff:
-	@echo >&2 'source and diff are obsolete - use dpkg-source -b' or dsc; false
-
-dsc:
-	-test -d debian/tmp && $(MAKE) -f debian/rules clean
-	if [ ! -f ../$(source)_$(version).orig.tar.gz -a -f ../orig/$(source)_$(version).orig.tar.gz ]; \
-	then \
-	  ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \
-	  touch /tmp/stamp-$(source)-link; \
-	fi; \
-	cd .. && dpkg-source -b $(source)-$(version)
-	if [ -f /tmp/stamp-$(source)-link ]; then \
-	  rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link; \
-	fi
-
 checkroot:
 	$(checkdir)
 	test root = "`whoami`"
 
-dist: binary dsc
-
 .PHONY: binary binary-arch binary-indep clean checkroot
-
diff -pruN 1.4.3-3.2/debian/source/format 1.4.3-5/debian/source/format
--- 1.4.3-3.2/debian/source/format	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/debian/source/format	2020-09-23 11:12:44.000000000 +0000
@@ -1 +1 @@
-1.0
+3.0 (quilt)
diff -pruN 1.4.3-3.2/docs/cfingerd.8 1.4.3-5/docs/cfingerd.8
--- 1.4.3-3.2/docs/cfingerd.8	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/docs/cfingerd.8	1999-09-04 22:39:28.000000000 +0000
@@ -33,7 +33,7 @@ options, this option is used in inetd.co
 is a totally new, and totally configurable finger daemon \- 
 one of the first.  It listenes on the finger port (port 79) to provide 
 useful information about each user that is on your system according to
-the finger protocol as described in RFC 1288.  Only thing is, cfingerd
+the finger protocol as described in RFC 1228.  Only thing is, cfingerd
 provides a unique twist.
 .PP
 .B CFINGERD
diff -pruN 1.4.3-3.2/docs/cfingerd.conf.5 1.4.3-5/docs/cfingerd.conf.5
--- 1.4.3-3.2/docs/cfingerd.conf.5	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/docs/cfingerd.conf.5	1999-09-04 22:39:28.000000000 +0000
@@ -8,8 +8,8 @@ cfingerd.conf \- configurable finger dae
 .SH DESCRIPTION
 .I cfingerd.conf
 is the configuration file for cfingerd.
-.B cfingerd
-has been totally rewritten
++.I cfingerd
++has been totally rewritten
 to support a more readable configuration file.  This version of the new 
 configuration file is
 .B NOT
@@ -24,7 +24,7 @@ Each one of those sections is split into
 explained next.
 .PP
 Subtext of each option is either boolean options, string options, or 
-switchable options, all changeable by the system administrator.
+switchable options, all changable by the system administrator.
 .PP
 Each section is split into a series of sections that resembles C type 
 definition; not exact, but close enough to be familiar with it.  :)  
@@ -529,7 +529,7 @@ is the string that is shown when the sys
 other sites for a user listing.
 .br
 .SH "INTERNAL STRINGS SECTION (CONFIG internal_strings)"
-These strings are changeable, and can be any length you want (within 
+These strings are changable, and can be any length you want (within 
 reason).  These strings are concattenated into the syslogging display 
 when the appropriate finger has been issued.  This section also includes 
 error messages that may occur.
@@ -607,9 +607,9 @@ matter.)  These are, instead, treated as
 called for your use.
 .PP
 The format is as follows for fake users:
-.br
+.sh
     "fake_username", "Script name", SEARCHBOOL, "script"
-.br
+.PP
 where...
 .PP
 .B fake_username
diff -pruN 1.4.3-3.2/docs/cfingerd.text.5 1.4.3-5/docs/cfingerd.text.5
--- 1.4.3-3.2/docs/cfingerd.text.5	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/docs/cfingerd.text.5	1999-09-04 22:39:28.000000000 +0000
@@ -1,6 +1,6 @@
 .TH CFINGERD.TEXT 5 "7 Aug 1999" "1.4.2" "Configurable Finger Daemon"
 .SH NAME
-cfingerd.text \- cfingerd text rules
+cfingerd text rules
 .br
 .SH "EXPLANATION"
 .B cfingerd
diff -pruN 1.4.3-3.2/Makefile.cfg.in 1.4.3-5/Makefile.cfg.in
--- 1.4.3-3.2/Makefile.cfg.in	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/Makefile.cfg.in	1999-08-31 00:46:46.000000000 +0000
@@ -1,6 +1,6 @@
 # CFINGERD - Main Makefile configuration
 #
-# $Id: Makefile.cfg.in,v 1.4 1999-08-31 00:46:46 joey Exp $
+# $Id: Makefile.cfg.in,v 1.4 1999/08/31 00:46:46 joey Exp $
 #
 # Copyright (c) 1999 by Martin Schulze <joey@infodrom.north.de>
 #
diff -pruN 1.4.3-3.2/perl/generic.pl 1.4.3-5/perl/generic.pl
--- 1.4.3-3.2/perl/generic.pl	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/perl/generic.pl	1999-08-31 00:46:46.000000000 +0000
@@ -14,11 +14,6 @@ sub get_os {
 	chop($uname);
 	$uname =~ tr/a-z/A-Z/;
 
-	# Tiny hack to make GNU/kFreeBSD and GNU/Hurd act as GNU/Linux
-	if (($uname eq 'GNU/KFREEBSD') || ($uname eq 'GNU')) {
-	    $uname = 'LINUX';
-	}
-
 	$ver = `uname -r`;
 	chop($ver);
 
diff -pruN 1.4.3-3.2/RECOMMEND 1.4.3-5/RECOMMEND
--- 1.4.3-3.2/RECOMMEND	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/RECOMMEND	1997-06-15 17:40:32.000000000 +0000
@@ -4,7 +4,7 @@ Recommended setups
 After running cfingerd for quite a while, I have found that if you make 
 the cfingerd setup the most secure, you will have the least problems.
 
-CFINGERD currently stops for all files from being symbolic links, char 
+CFINGERD currently stops all files from being symbolic links, char 
 devices, block devices, etc.  Basically, each file has to be a normal 
 file in order to be read by cfingerd.  With that in mind, you should keep 
 all files (whether or not they are read by root) as normal files.  This 
diff -pruN 1.4.3-3.2/src/cfingerd.h 1.4.3-5/src/cfingerd.h
--- 1.4.3-3.2/src/cfingerd.h	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/cfingerd.h	1999-08-29 08:58:29.000000000 +0000
@@ -278,11 +278,10 @@ typedef struct ecruft {
 
 extern CONFIG prog_config;
 extern ECRUFT errors[];
-extern char remote_addr[], ip_address[];
-extern char *localhost, *ident_user;
+extern char *remote_addr, *localhost, *ident_user, *ip_address;
 extern int trusted_host_num, rejected_host_num, forward_host_num,
-	   fakeuser_num, num_finger_sites, num_headers, can_log;
-extern unsigned short local_port, remote_port;
+	   fakeuser_num, num_finger_sites, num_headers, local_port,
+	   remote_port, can_log;
 extern FILE *top_display, *bottom_display, *noname_display, *nouser_display,
 	    *rejected_display, *identd_display;
 extern BOOL local_finger, emulated;
@@ -294,4 +293,4 @@ extern unsigned long listen_addr;
 
 #include "defines.h"
 
-#endif /* _CFINGERD_H_ */
+#endif _CFINGERD_H_
diff -pruN 1.4.3-3.2/src/fakeuser.c 1.4.3-5/src/fakeuser.c
--- 1.4.3-3.2/src/fakeuser.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/fakeuser.c	1999-09-29 07:04:24.000000000 +0000
@@ -79,7 +79,7 @@ void handle_fakeuser(char *username)
 	    printf("\n                    Sorry, you specified too many options.\n\n");
 	    fflush(stdout);
 	    show_bottom();
-	    mylog(LOG_WARN, "Too many options specified in fake user finger", NULL);
+	    log(LOG_WARN, "Too many options specified in fake user finger", NULL);
 	    return;
  	}
 
@@ -105,7 +105,7 @@ void handle_fakeuser(char *username)
 	    sscanf(username, "%[^.].%[^.].%[^.].%[^.].%[^\r\n]\r\n",
 		data[0], data[1], data[2], data[3], data[4]);
 
-	mylog(LOG_USER, "Fakeuser: ", username);
+	log(LOG_USER, "Fakeuser: ", username);
 
 	funum = search_fake_pos(data[0]);
 
@@ -133,7 +133,7 @@ void handle_fakeuser(char *username)
     } else {
 	printf("\n");
 	printf("             Sorry, this system does not have any fake users enabled!\n\n");
-	mylog(LOG_WARN, "Fake user requested, but rejected - disabled.", " ");
+	log(LOG_WARN, "Fake user requested, but rejected - disabled.", " ");
     }
 
     show_bottom();
diff -pruN 1.4.3-3.2/src/internal.c 1.4.3-5/src/internal.c
--- 1.4.3-3.2/src/internal.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/internal.c	1999-08-29 08:58:29.000000000 +0000
@@ -72,26 +72,26 @@ void handle_internal(char *username)
     else if (!strncmp(username, "services", 8)) {
 	show_services();
 	syslog(LOG_NOTICE, "%s", prog_config.p_strings[D_SVC_FINGER]);
-	mylog(LOG_USER, "Service request", " ");
+	log(LOG_USER, "Service request", " ");
 	exit(PROGRAM_OKAY);
     } else if (!strncmp(username, "search", 6)) {
 	show_search(username);
 	exit(PROGRAM_OKAY);
     } else if (!strncmp(username, "userlist-only", 13)) {
-	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist | /usr/bin/tail -n +2")) != NULL) {
+	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist | /usr/bin/tail +2")) != NULL) {
 	    printf ("%s", buf);
 	    fflush(stdout);
 	    free (buf);
 	}
-	mylog(LOG_USER, "Userlist-only", " ");
+	log(LOG_USER, "Userlist-only", " ");
 	exit(PROGRAM_OKAY);
     } else if (!strncmp(username, "userlist-online", 15)) {
-	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist -c -n | /usr/bin/tail -n +2")) != NULL) {
+	if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, "/usr/sbin/userlist -c -n | /usr/bin/tail +2")) != NULL) {
 	    printf ("%s", buf);
 	    fflush(stdout);
 	    free (buf);
 	}
-	mylog(LOG_USER, "Userlist-only", " ");
+	log(LOG_USER, "Userlist-only", " ");
 	exit(PROGRAM_OKAY);
     } else if (!strncmp(username, "help", 4)) {
 	show_top();
diff -pruN 1.4.3-3.2/src/log.c 1.4.3-5/src/log.c
--- 1.4.3-3.2/src/log.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/log.c	1999-07-07 23:18:26.000000000 +0000
@@ -17,7 +17,7 @@
 #include "proto.h"
 #include "privs.h"
 
-void mylog(int logtype, char *msg, char *user)
+void log(int logtype, char *msg, char *user)
 {
     if (can_log && (prog_config.config_bits3 & SHOW_LOG)) {
 	time_t tim = time(NULL);
@@ -80,7 +80,7 @@ void userlog(uid_t uid, gid_t gid, char
     } else {
 	if (!(prog_config.config_bits3 & SHOW_CREATE_FLG)) {
 	    syslog(LOG_WARNING, "Userlog: %s (%s)", filename, strerror(errno));
-	    mylog(LOG_ERROR, "Cannot write to userlog: ", strerror(errno));
+	    log(LOG_ERROR, "Cannot write to userlog: ", strerror(errno));
 	}
     }
 }
diff -pruN 1.4.3-3.2/src/main.c 1.4.3-5/src/main.c
--- 1.4.3-3.2/src/main.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/main.c	1999-08-06 21:33:38.000000000 +0000
@@ -20,13 +20,11 @@
 #include "privs.h"
 
 CONFIG prog_config;
-char *localhost, *ident_user;
-char ip_address[INET6_ADDRSTRLEN] = "";
-char remote_addr[INET6_ADDRSTRLEN] = "";
+char *remote_addr, *localhost, *ident_user, *ip_address;
 FILE *top_display, *bottom_display, *noname_display, *nouser_display,
      *rejected_display, *identd_display;
 BOOL local_finger, emulated; 
-unsigned short local_port, remote_port;
+int local_port, remote_port;
 unsigned short listen_port;
 unsigned long listen_addr;
 
@@ -64,15 +62,14 @@ int main(int argc, char *argv[])
     char line[100], username[80], syslog_str[200];
     int un_type;
     char *cp;
-    struct sockaddr_storage local_addr;
-    struct sockaddr_in *sloc4 = (struct sockaddr_in *) &local_addr;
-    struct sockaddr_in6 *sloc6 = (struct sockaddr_in6 *) &local_addr;
+    struct sockaddr_in local_addr;
     struct servent *serv;
 
     if ((serv = getservbyname("finger","tcp")) != NULL)
 	listen_port = serv->s_port;
     else
 	listen_port = htons(79);
+    listen_addr = htonl(INADDR_ANY);
 
     /* Initialize CFINGERD */
     start_handler();
@@ -111,12 +108,12 @@ int main(int argc, char *argv[])
     /* Make sure there is actually data waiting in the finger port */
     if (!emulated) {
 	if (!fgets(username, sizeof(username), stdin)) {
-	  if (remote_addr != NULL && *remote_addr) {
+	  if (remote_addr != NULL) {
 	    syslog(LOG_ERR, "Null query from %s: %m", remote_addr);
-	    mylog(LOG_ERROR, remote_addr, strerror(errno));
+	    log(LOG_ERROR, remote_addr, strerror(errno));
 	  } else {
 	    syslog(LOG_ERR, "Null query: %m");
-	    mylog(LOG_ERROR, strerror(errno), strerror(0));
+	    log(LOG_ERROR, strerror(errno), strerror(0));
 	  }
 	    closelog();
 	    exit(PROGRAM_SYSLOG);
@@ -150,64 +147,33 @@ int main(int argc, char *argv[])
     /* If we're not doing emulated stuff, we can assume that we are running
        either as a daemon, or under INETD.  In that case... */
     if (!emulated) {
-	struct sockaddr_storage socket_addr;
-	struct sockaddr_in *srem4 = (struct sockaddr_in *) &socket_addr;
-	struct sockaddr_in6 *srem6 = (struct sockaddr_in6 *) &socket_addr;
+	struct sockaddr_in socket_addr;
 	struct hostent *host_ent;
-	socklen_t locsize = 0, remsize = 0;
+	int psize = 0;
 
 	/* Can't run from command line (but this should already be checked) */
-	locsize = sizeof(local_addr);
+	psize = sizeof(socket_addr);
 
-	if (getsockname(0, (struct sockaddr *) &local_addr, &locsize)) {
+	if (getsockname(0, (struct sockaddr *) &local_addr, &psize)) {
 	    syslog(LOG_WARNING, "getsockname: %s", strerror(errno));
 	    local_port = 0;
 	} else
-	    switch (local_addr.ss_family) {
-		case AF_INET6:
-		    local_port = ntohs(sloc6->sin6_port);
-		    break;
-		case AF_INET:
-		default:
-		    local_port = ntohs(sloc4->sin_port);
-	    }
-
-	remsize = sizeof(socket_addr);
+	    local_port = ntohs(local_addr.sin_port);
 
-	if (getpeername(0, (struct sockaddr *) &socket_addr, &remsize)) {
+	if (getpeername(0, (struct sockaddr *) &socket_addr, &psize)) {
 	    printf("Internal error - not running as either a daemon or under INETD.\n");
 	    printf("Fatal - getpeername: %s\n", strerror(errno));
 	    closelog();
-	    mylog(LOG_ERROR, "getpeername: ", strerror(errno));
+	    log(LOG_ERROR, "getpeername: ", strerror(errno));
 	    exit(PROGRAM_BUG);
 	} else
-	    switch (socket_addr.ss_family) {
-		case AF_INET6:
-		    remote_port = ntohs(srem6->sin6_port);
-		    break;
-		case AF_INET:
-		default:
-		    remote_port = ntohs(srem4->sin_port);
-	    }
+	    remote_port = ntohs(socket_addr.sin_port);
 
-	inet_ntop(socket_addr.ss_family, &socket_addr,
-			ip_address, INET6_ADDRSTRLEN);
+	ip_address = inet_ntoa (socket_addr.sin_addr);
 
 	/* Get our host entry */
-	switch (socket_addr.ss_family) {
-	    case AF_INET6:
-		host_ent = (struct hostent *)
-				gethostbyaddr((char *) &srem6->sin6_addr,
-					sizeof(struct in6_addr),
-					socket_addr.ss_family);
-		break;
-	    case AF_INET:
-	    default:
-		host_ent = (struct hostent *)
-				gethostbyaddr((char *) &srem4->sin_addr,
-					sizeof(struct in_addr),
-					socket_addr.ss_family);
-	}
+	host_ent = (struct hostent *) gethostbyaddr((char *) &socket_addr.sin_addr,
+		   sizeof(socket_addr.sin_addr), AF_INET);
 
 	/* And get our local-host name */
 #ifndef	ACTUAL_HOSTNAME
@@ -218,14 +184,14 @@ int main(int argc, char *argv[])
 
 	/* Make sure we can get the remote host's address name */
 	if (host_ent == NULL) {
-	    strncpy(remote_addr, ip_address, INET6_ADDRSTRLEN);
+	    remote_addr = inettos(socket_addr.sin_addr.s_addr);
 	    syslog(LOG_WARNING, "%s %s", 
 		prog_config.p_strings[D_IP_NO_MATCH],
 		remote_addr);
 	    if (!(prog_config.config_bits2 & SHOW_IP_MATCH))
 		CF_ERROR(E_NOIP);
 	} else
-	    strncpy(remote_addr, host_ent->h_name, INET6_ADDRSTRLEN);
+	    remote_addr = (char *) host_ent->h_name;
 
 	/* Convert any uppercase letters in the hostname to lowercase */
 	for (cp = remote_addr; *cp; cp++)
@@ -234,17 +200,14 @@ int main(int argc, char *argv[])
 
 	/* And find out if this is a local finger */
 	if (!strncasecmp(remote_addr, "127.0.0.1", 9) ||
-	    !strncasecmp(remote_addr, "::1", 3) ||
 	    !strncasecmp(remote_addr, "localhost", 9) ||
-	    !strncasecmp(remote_addr, "ip6-localhost", 9) ||
-	    !strncasecmp(remote_addr, "ip6-loopback", 9) ||
 	    !strncasecmp(remote_addr, "127.0.0.0", 9) || /* KTH 07/26/96 */
 	    !strncasecmp(remote_addr, localhost, strlen(localhost)))
 	    local_finger = TRUE;
 	else
 	    local_finger = FALSE;
 
-	ident_user = get_rfc1413_data(&local_addr, &socket_addr);
+	ident_user = get_rfc1413_data(local_addr);
 	set_time_format();
 
     } else
@@ -257,9 +220,9 @@ int main(int argc, char *argv[])
 	memset (ident_user, 0, sizeof (ident_user));
 	strcpy (ident_user, "emulated");
 #ifndef	ACTUAL_LOOPBACK
-	strcpy(remote_addr,"127.0.0.1");
+	remote_addr = "127.0.0.1";
 #else
-	strcpy(remote_addr, ACTUAL_LOOPBACK);
+	remote_addr = ACTUAL_LOOPBACK;
 #endif
     }
 
@@ -279,7 +242,7 @@ int main(int argc, char *argv[])
 	    if (!emulated) {
 		snprintf(syslog_str, sizeof(syslog_str), "%s fingered (internal) from %s", username,
 		    ident_user);
-		syslog(LOG_NOTICE, "%s", (char *) syslog_str);
+		syslog(LOG_NOTICE, (char *) syslog_str);
 	    }
 
 	    handle_internal(username);
@@ -292,7 +255,7 @@ int main(int argc, char *argv[])
 		    snprintf(syslog_str, sizeof(syslog_str), "%s fingered from %s",
 			prog_config.p_strings[D_ROOT_FINGER], ident_user);
 
-		syslog(LOG_NOTICE, "%s", (char *) syslog_str);
+		syslog(LOG_NOTICE, (char *) syslog_str);
 	    }
 
 	    handle_standard(username);
@@ -302,7 +265,7 @@ int main(int argc, char *argv[])
 		snprintf(syslog_str, sizeof(syslog_str), "%s %s from %s", username, 
 		    prog_config.p_strings[D_FAKE_USER], ident_user);
 
-		syslog(LOG_NOTICE, "%s", (char *) syslog_str);
+		syslog(LOG_NOTICE, (char *) syslog_str);
 	    }
 
 	    handle_fakeuser(username);
diff -pruN 1.4.3-3.2/src/parse.c 1.4.3-5/src/parse.c
--- 1.4.3-3.2/src/parse.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/parse.c	1999-09-29 07:04:24.000000000 +0000
@@ -137,14 +137,14 @@ int process_username(char *username)
 	if (ret == U_FORWARD) {
 	    printf("%s\n", prog_config.p_strings[D_FORWARD_DENY]);
 	    fflush(stdout);
-	    mylog(LOG_USER, "Denied forward: ", username);
+	    log(LOG_USER, "Denied forward: ", username);
 	    exit(1);
 	}
 
 	if (ret == U_ILLEGAL) {
 	    printf("Illegal character in username.\n");
 	    fflush(stdout);
-	    mylog(LOG_USER, "Illegal: ", username);
+	    log(LOG_USER, "Illegal: ", username);
 	    exit(1);
 	}
 
diff -pruN 1.4.3-3.2/src/proto.h 1.4.3-5/src/proto.h
--- 1.4.3-3.2/src/proto.h	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/proto.h	1999-08-29 08:58:30.000000000 +0000
@@ -45,9 +45,9 @@ void show_search(char *);
 void become_nobody(void);
 void become_user(char *);
 int wildmat(char *, char *);
-char *get_rfc1413_data(struct sockaddr_storage *, struct sockaddr_storage *);
+char *get_rfc1413_data(struct sockaddr_in );
 void check_unknown(char *);
-void mylog(int, char *, char *);
+void log(int, char *, char *);
 void userlog(uid_t, gid_t, char *, char *);
 void check_blank_configurations(void);
 int search_fake_pos(char *);
diff -pruN 1.4.3-3.2/src/rfc1413.c 1.4.3-5/src/rfc1413.c
--- 1.4.3-3.2/src/rfc1413.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/rfc1413.c	1999-08-29 12:14:25.000000000 +0000
@@ -25,75 +25,45 @@ void rfc1413_alarm(int signal)
  * the implementation.  Completely rewritten by yours truly to be self-
  * contained in a single program.  Simple, easy to use.
  */
-#define UNAMELEN   64
-#define BUFLEN     UNAMELEN + INET6_ADDRSTRLEN + 2
-#define INPUTLEN   256
-char *get_rfc1413_data(struct sockaddr_storage * local_addr,
-			struct sockaddr_storage * peer_addr )
+#define BUFLEN	256
+char *get_rfc1413_data( struct sockaddr_in local_addr )
 {
     int i, j;
-    unsigned short newport;
-    struct sockaddr_storage sin;
-    struct sockaddr_in *sa4 = (struct sockaddr_in *) &sin;
-    struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &sin;
-    char buffer[1024], buf[INPUTLEN], uname[UNAMELEN], *bleah;
+    struct sockaddr_in sin;
+    char buffer[1024], buf[BUFLEN], uname[64], *bleah;
     char *cp, *xp;
     struct servent *serv;
 
     bleah = (char *) malloc(BUFLEN);
     memset(bleah, 0, BUFLEN);
 
-    j = socket(local_addr->ss_family, SOCK_STREAM, 0);
+    j = socket(AF_INET, SOCK_STREAM, 0);
     if (j < 2) {
 	snprintf(bleah, BUFLEN, "unknown@%s", remote_addr);
 	syslog(LOG_ERR, "rfc1413-socket: %s", strerror(errno));
 	return(bleah);
     }
 
-    memcpy(&sin, local_addr, sizeof(sin));
-    switch (sin.ss_family) {
-	case AF_INET6:
-	    sa6->sin6_port = 0;
-	    break;
-	case AF_INET:
-	default:
-	    sa4->sin_port = 0;
-    }
-
-    i = bind(j, (struct sockaddr *) &sin, 
-		    (sin.ss_family == AF_INET6 )
-			? sizeof(struct sockaddr_in6)
-			: sizeof(struct sockaddr_in));
-
+    sin.sin_family = AF_INET;
+    sin.sin_addr.s_addr = local_addr.sin_addr.s_addr;
+    sin.sin_port = 0;
+    i = bind(j, (struct sockaddr *) &sin, sizeof(sin));
     if (i < 0) {
 	snprintf(bleah, BUFLEN, "unknown@%s", remote_addr);
 	syslog(LOG_ERR, "rfc1413-socket: %s", strerror(errno));
 	return(bleah);
     }
 
+    sin.sin_family = AF_INET;
     if ((serv = getservbyname("auth","tcp")) != NULL)
-	newport = serv->s_port;
+	sin.sin_port = serv->s_port;
     else
-	newport = htons(113);
-
-    memcpy(&sin, peer_addr, sizeof(sin));
-    switch (sin.ss_family) {
-	case AF_INET6:
-	    sa6->sin6_port = newport;
-	    break;
-	case AF_INET:
-	default:
-	    sa4->sin_port = newport;
-    }
-
+	sin.sin_port = htons(113);
+    sin.sin_addr.s_addr = inet_addr(ip_address);
     signal(SIGALRM, rfc1413_alarm);
     alarm(5);
 
-    i = connect(j, (struct sockaddr *) &sin,
-		    (sin.ss_family == AF_INET6 )
-			? sizeof(struct sockaddr_in6)
-			: sizeof(struct sockaddr_in));
-
+    i = connect(j, (struct sockaddr *) &sin, sizeof(sin));
     if (i < 0) {
 	syslog(LOG_ERR, "rfc1413-connect: %s", strerror(errno));
 	close(j);
@@ -128,8 +98,7 @@ char *get_rfc1413_data(struct sockaddr_s
 
 	if (*(++cp) == ' ') cp++;
 	memset(uname, 0, sizeof(uname));
-	for (xp=uname; *cp != '\0' && *cp!='\r'&&*cp!='\r'&&*cp!='\n'&&(strlen(uname)+1)<sizeof(uname); cp++)
-
+	for (xp=uname; *cp != '\0' && *cp!='\r'&&*cp!='\n'&&strlen(uname)<sizeof(uname); cp++)
 	    *(xp++) = *cp;
 
 	if (!strlen(uname)) {
diff -pruN 1.4.3-3.2/src/search.c 1.4.3-5/src/search.c
--- 1.4.3-3.2/src/search.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/search.c	1999-09-29 07:04:24.000000000 +0000
@@ -36,7 +36,7 @@ void show_search(char *uname)
     SEARCHLIST searches[MAX_SEARCHES];
     FILE *file;
     char *cp;
-    char *xp;
+    char *xp, y;
 
     show_top();
 
@@ -56,6 +56,13 @@ void show_search(char *uname)
 	exit(PROGRAM_OKAY);
     }
 
+    for (cp=searchname,xp=searchname,y=0;*cp;cp++) {
+	if (y != *cp)
+	    *(xp++) = *cp;
+	y = *cp;
+    }
+    *xp = '\0';
+	
     if (strlen((char *) searchname) == 0) {
 	printf("\n                    You must supply a name to search for!\n");
 	SEND_RAW_RETURN;
@@ -68,7 +75,7 @@ void show_search(char *uname)
 	printf("\n                    You must supply a name to search for!\n");
 	SEND_RAW_RETURN;
 	show_bottom();
-	mylog(LOG_USER, "Security breach: finger * from %s", ident_user);
+	log(LOG_USER, "Security breach: finger * from %s", ident_user);
 	syslog(LOG_WARNING, "Security breach: finger * from %s", ident_user);
 	free (searchname);
 	exit(PROGRAM_OKAY);
@@ -78,7 +85,7 @@ void show_search(char *uname)
       if (isupper(*cp))
 	*cp = tolower(*cp);
 
-    mylog(LOG_USER, "Search: ", searchname);
+    log(LOG_USER, "Search: ", searchname);
 
     NOBODY_PRIVS;
 
diff -pruN 1.4.3-3.2/src/signal.c 1.4.3-5/src/signal.c
--- 1.4.3-3.2/src/signal.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/signal.c	1998-10-17 18:35:57.000000000 +0000
@@ -81,7 +81,7 @@ void int_handler(int signo)
 
 	    if (siglist[i].fatal) {
 		printf("\nPlease report this bug to %s!\n", ERRORS_TO);
-		mylog(LOG_ERROR, "Signal (fatal): ", siglist[i].sigtype);
+		log(LOG_ERROR, "Signal (fatal): ", siglist[i].sigtype);
 	    } else {
 		if (siglist[i].value == SIGALRM) {
 		    printf("Ooh, you caught an alarm signal.  This may be a cause from either not\n");
@@ -89,7 +89,7 @@ void int_handler(int signo)
 		    printf("out on you.  May want to check this.  :)\n\n");
 		}
 
-		mylog(LOG_WARN, "Signal: Alarm signal", " ");
+		log(LOG_WARN, "Signal: Alarm signal", " ");
 
 		printf("Non-fatal; continuing.\n");
 	    }
@@ -99,7 +99,7 @@ void int_handler(int signo)
 	    if (siglist[i].fatal)
 		exit(PROGRAM_BUG);
 	    else
-		mylog(LOG_WARN, "Signal (non-fatal): ", siglist[i].sigtype);
+		log(LOG_WARN, "Signal (non-fatal): ", siglist[i].sigtype);
 	}
     }
 
@@ -109,7 +109,7 @@ void int_handler(int signo)
 	syslog(LOG_ERR, "SIGUNKNOWN caught");
 	(void) fflush(stdout);
 
-	mylog(LOG_ERROR, "Signal: Unknown signal", " ");
+	log(LOG_ERROR, "Signal: Unknown signal", " ");
 
 	exit(PROGRAM_BUG);
     }
diff -pruN 1.4.3-3.2/src/standard.c 1.4.3-5/src/standard.c
--- 1.4.3-3.2/src/standard.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/standard.c	1999-09-29 07:04:24.000000000 +0000
@@ -155,7 +155,6 @@ void show_pfile(uid_t uid, gid_t gid, in
 	    fflush(stdout);
 	}
 
-	USER_PRIVS(uid, gid);
 	if (exist(d)) {
 	    NOBODY_PRIVS;
 
@@ -164,14 +163,9 @@ void show_pfile(uid_t uid, gid_t gid, in
 		fflush(stdout);
 	    }
 
-	    USER_PRIVS(uid, gid);
 	    if ((file = open_file(d)) != NULL)
-	    {
-		NOBODY_PRIVS;
 		display_file(uid, gid, file);
-           }
 	} else {
-	    NOBODY_PRIVS;
 	    if (!(prog_config.config_bits3 & SHOW_HEADERS_FE))
 		printf("%s\n", prog_config.p_strings[t3]);
 	    else
@@ -212,7 +206,6 @@ void show_pfile2(uid_t uid, gid_t gid, i
 	    fflush(stdout);
 	}
 
-	USER_PRIVS(uid, gid);
 	if (exist(d)) {
 	    NOBODY_PRIVS;
 
@@ -221,13 +214,9 @@ void show_pfile2(uid_t uid, gid_t gid, i
 		fflush(stdout);
 	    }
 
-	    USER_PRIVS(uid, gid);
-	    if ((file = open_file (d)) != NULL) {
-		NOBODY_PRIVS;
+	    if ((open_file (d)) != NULL)
 		display_file(uid, gid, file);
-           }
 	} else {
-	    NOBODY_PRIVS;
 	    if (!(prog_config.config_bits3 & SHOW_HEADERS_FE))
 		printf("%s\n", prog_config.p_strings[t3]);
 	}
@@ -387,21 +376,11 @@ void show_idle(char *tty)
     sprintf(dev_file, "/dev/%s", tty);
 
     USER_PRIVS(nuid, ngid);
-    if (stat((char *) dev_file, &buf) != 0) {
-	NOBODY_PRIVS;
-	return;
-    }
+    stat((char *) dev_file, &buf);
     NOBODY_PRIVS;
 
-    if (!buf.st_atime || !buf.st_mtime)
-	return;
-
     cur_time = time(NULL);
-    diff_time = buf.st_mtime < buf.st_atime
-		? (long) cur_time - (long) buf.st_mtime
-		: (long) cur_time - (long) buf.st_atime;
-    if (diff_time < 0)
-	diff_time = 0;
+    diff_time = (long) cur_time - (long) buf.st_mtime;
 
     sec = min = hour = day = has = 0;
 
@@ -415,7 +394,7 @@ void show_idle(char *tty)
 	sec = has = 1;
 
     if (has)
-	printf(" idle ");
+	printf(" Idle ");
 
     if (day) {
 	day = diff_time / 86400;
@@ -1023,21 +1002,21 @@ void handle_standard(char *username)
 		memset(uname, 0, 600);
 		printf("\nChecking site %s for the specified user.\n", prog_config.forward[nums]);
 		fflush(stdout);
-		snprintf(uname, sizeof(uname), "/usr/bin/finger \"%s\100%s\" | /usr/bin/tail -n +2", username, prog_config.forward[nums]);
+		snprintf(uname, sizeof(uname), "/usr/bin/finger \"%s\100%s\" | /usr/bin/tail +2", username, prog_config.forward[nums]);
 		if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, uname)) != NULL) {
 		    printf ("%s", buf);
 		    fflush(stdout);
 		    free (buf);
 		}
 		nums++;
-		mylog(LOG_USER, "Forwarded: ", username);
+		log(LOG_USER, "Forwarded: ", username);
 	    }
 	} else {
 	    show_notexist();
 	}
     } else {
 	show_fingerinfo(username);
-	mylog(LOG_USER, "Normal: ", username);
+	log(LOG_USER, "Normal: ", username);
     }
 
     if ((!(prog_config.config_bits2 & SHOW_FINGERFWD)) || 
diff -pruN 1.4.3-3.2/src/userlist.c 1.4.3-5/src/userlist.c
--- 1.4.3-3.2/src/userlist.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/userlist.c	1999-08-29 09:57:25.000000000 +0000
@@ -56,10 +56,10 @@ void handle_userlist(char *username)
 
 		    if (!strcmp (username, "userlist"))
 			snprintf(cmdline, sizeof (cmdline),
-				 "%s -n | /usr/bin/tail -n +2", prog_config.finger_program);
+				 "%s -n | /usr/bin/tail +2", prog_config.finger_program);
 		    else
 			snprintf(cmdline, sizeof (cmdline),
-				 "%s | /usr/bin/tail -n +2", prog_config.finger_program);
+				 "%s | /usr/bin/tail +2", prog_config.finger_program);
 
 		    if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, cmdline)) != NULL) {
 			if (!head) {
@@ -72,10 +72,10 @@ void handle_userlist(char *username)
 		    }
 		} else {
 		    if (!strcmp (username, "userlist"))
-			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-online@%s | tail -n +2 | grep -v '^$'",
+			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-online@%s | tail +2 | grep -v '^$'",
 				 prog_config.finger_sites[i]);
 		    else
-			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-only@%s | tail -n +2 | grep -v '^$'",
+			snprintf(cmdline, sizeof(cmdline), "/usr/bin/finger userlist-only@%s | tail +2 | grep -v '^$'",
 				 prog_config.finger_sites[i]);
 
 		    if ((buf = safe_exec(NOBODY_UID, NOBODY_GID, cmdline)) != NULL) {
@@ -92,7 +92,7 @@ void handle_userlist(char *username)
 	} else {
 	    if ((!strstr(prog_config.finger_program, "finger")) &&
 		(!strstr(prog_config.finger_program, "w")))
-		snprintf(cmdline, sizeof(cmdline), "%s | /usr/bin/tail -n +2", prog_config.finger_program);
+		snprintf(cmdline, sizeof(cmdline), "%s | /usr/bin/tail +2", prog_config.finger_program);
 	    else 
 		snprintf(cmdline, sizeof(cmdline), "%s", prog_config.finger_program);
 
@@ -144,7 +144,7 @@ void handle_userlist(char *username)
 
     show_bottom();
 
-    mylog(LOG_USER, "Userlist request", " ");
+    log(LOG_USER, "Userlist request", " ");
 }
 
 /*
diff -pruN 1.4.3-3.2/src/util.c 1.4.3-5/src/util.c
--- 1.4.3-3.2/src/util.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/util.c	1999-09-29 07:04:24.000000000 +0000
@@ -178,7 +178,7 @@ void parse_line(uid_t uid, gid_t gid, ch
 
 	    pos++;
 
-	    while (line[pos] != ' ' && !done && newpos < 80) {
+	    while((line[pos] != ' ') && (!done)) {
 		command[newpos] = line[pos];
 
 		if (line[pos] == ' ')
@@ -298,7 +298,7 @@ void parse_line(uid_t uid, gid_t gid, ch
 	    for(x = 0; x < center_dist; x++)
 		printf(" ");
 
-	printf("%s", displine);
+	printf(displine);
 
 	free(displine);
     }
@@ -465,7 +465,7 @@ char *get_localhost(void)
     ret = (char *) malloc(strlen((char *) hostname) +
 			  strlen((char *) domname) + 2);
 
-    sprintf(ret, "%s.%s", (char *) hostname, (char *) domname);
+    snprintf(ret, sizeof(ret), "%s.%s", (char *) hostname, (char *) domname);
     return(ret);
 }
 
@@ -483,7 +483,7 @@ void check_unknown(char *host)
 	    host, prog_config.p_strings[D_REJECT_HOST]);
 	if (prog_config.config_bits2 & SHOW_REJECTED)
 	    display_file(NOBODY_UID, NOBODY_GID, rejected_display);
-	mylog(LOG_IDENT, "Unknown not allowed from ", host);
+	log(LOG_IDENT, "Unknown not allowed from ", host);
 
 	exit(PROGRAM_OKAY);
     }
@@ -537,7 +537,7 @@ void check_rejected(char *host)
 	    if (prog_config.config_bits2 & SHOW_REJECTED)
 		display_file(NOBODY_UID, NOBODY_GID, rejected_display);
 
-	    mylog(LOG_REJECTED, "Rejected host finger detected to ", host);
+	    log(LOG_REJECTED, "Rejected host finger detected to ", host);
 
 	    exit(PROGRAM_OKAY);
 	}
@@ -588,6 +588,7 @@ char *safe_exec (uid_t uid, gid_t gid, c
 	memset (line, 0, 600);
 	while ((read (fd[0], line, sizeof (line)-1)) > 0) {
 	    if ((size += strlen (line)) < MAX_POPEN_BUF) {
+		syslog (LOG_INFO, "Reallocating %d bytes", size);
 		if ((result = (char *) realloc (result, size+1)) == NULL) {
 		    return NULL;
 		}
diff -pruN 1.4.3-3.2/src/version.c 1.4.3-5/src/version.c
--- 1.4.3-3.2/src/version.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/src/version.c	1999-07-30 08:18:55.000000000 +0000
@@ -45,7 +45,7 @@ void show_version_info(void)
     printf("The last stable version of CFINGERD is %s\n\n", LAST_STABLE_RELEASE);
 #endif
 
-    mylog(LOG_USER, "Version information", " ");
+    log(LOG_USER, "Version information", " ");
 
     fflush(stdout);
     exit(PROGRAM_OKAY);
diff -pruN 1.4.3-3.2/userlist/display.c 1.4.3-5/userlist/display.c
--- 1.4.3-3.2/userlist/display.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/userlist/display.c	1999-09-29 07:04:24.000000000 +0000
@@ -79,7 +79,7 @@ void process_display(void)
 
 	if (strlen((char *) tty_list[i].username) > 1) {
 	    char *username=NULL;
-	    char ru[9], fn[STRLEN];
+	    char ru[8], fn[STRLEN];
 
 	    memset(ru, 0, sizeof (ru));
 	    memset(fn, 0, sizeof (fn));
@@ -89,8 +89,6 @@ void process_display(void)
 	    pwent = getpwnam((char *) ru);
 
 	    if (pwent) {
-		char *cp, *x;
-
 		cp = pwent->pw_gecos;
 		if ((x = index (pwent->pw_gecos, ',')) != NULL) /* username */
 		    *x = '\0';
diff -pruN 1.4.3-3.2/userlist/idle.c 1.4.3-5/userlist/idle.c
--- 1.4.3-3.2/userlist/idle.c	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/userlist/idle.c	1999-08-05 22:52:37.000000000 +0000
@@ -24,16 +24,10 @@ char *calc_idle(char *tty)
 
     snprintf(dev_file, sizeof (dev_file), "/dev/%s", tty);
 
-    if (stat((char *) dev_file, &buf) != 0 || !buf.st_atime || !buf.st_mtime) {
-	sprintf(idledisp, "-");
-	return idledisp;
-    }
+    stat((char *) dev_file, &buf);
     cur_time = time(NULL);
-    diff_time = buf.st_mtime < buf.st_atime
-		? (long) cur_time - (long) buf.st_mtime
-		: (long) cur_time - (long) buf.st_atime;
-    if (diff_time < 0)
-	diff_time = 0;
+
+    diff_time = (long) cur_time - (long) buf.st_mtime;
 
     min = hour = day = 0;
 
@@ -51,7 +45,7 @@ char *calc_idle(char *tty)
 
     if (day) {
 	if (no_idle) return NULL;
-	snprintf(idledisp, sizeof (idledisp), "%1dd", day);
+	snprintf(idledisp, sizeof (idledisp), "%1dd ", day);
 	return idledisp;
     }
 
diff -pruN 1.4.3-3.2/userlist/userlist.1 1.4.3-5/userlist/userlist.1
--- 1.4.3-3.2/userlist/userlist.1	2020-09-23 15:42:55.000000000 +0000
+++ 1.4.3-5/userlist/userlist.1	1999-09-04 22:39:30.000000000 +0000
@@ -8,7 +8,7 @@ userlist \- Userlisting of who's on your
 .SH DESCRIPTION
 This program simply gives you a listing of who is connected to your 
 system.  It is used primarily in the sorted listing of
-.BR cfingerd ,
+.Br cfingerd ,
 which 
 utilitizes the same method of display for a more uniform output between 
 systems.  (It also made more sense to do it this way instead of having 
@@ -40,7 +40,7 @@ it checks getpwnam, anyway.  :)
 .B "\-c"
 Give standard CFINGERD (custom) output.
 .TP
-.B "\-n"
+.B. "\-n"
 List only people idle less than one day.
 .br
 .SH ADDITIONAL
