diff -Nru cfingerd-1.4.3/Configure cfingerd-1.4.3/Configure --- cfingerd-1.4.3/Configure 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/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 -Nru cfingerd-1.4.3/CREDITS cfingerd-1.4.3/CREDITS --- cfingerd-1.4.3/CREDITS 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/CREDITS 1999-08-29 17:45:44.000000000 +0000 @@ -48,7 +48,7 @@ - Shadow password testing - Secure (NOBODY PATCH) finger help -David Muench +cc@spork.neonexus.com - Finger forwarding idea Rich Salz @@ -76,13 +76,3 @@ Alexey M. Zelkin - Support for FreeBSD - -Kevin Rosenberg - - Get UTMP file entries for BSD compatibility - -Thomas Koenig - - Management of e?uid switching - -Lars Mathiesen - - ABORT code for wildmat - diff -Nru cfingerd-1.4.3/debian/changelog cfingerd-1.4.3/debian/changelog --- cfingerd-1.4.3/debian/changelog 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/debian/changelog 2021-02-05 14:40:24.000000000 +0000 @@ -1,10 +1,46 @@ -cfingerd (1.4.3-3.2ubuntu1) zesty; urgency=medium +cfingerd (1.4.3-5ubuntu1) hirsute; urgency=medium - * Merge from Debian unstable. Remaining changes: + * Resynchronize on Debian, remaining Ubuntu change - debian/control: Add openbsd-inetd | inet-superserver dependencies, as cfingerd needs an inet server to work. - -- Bhavani Shankar Mon, 02 Jan 2017 09:45:59 +0530 + -- Sebastien Bacher Fri, 05 Feb 2021 15:40:24 +0100 + +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 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 Sat, 25 Jul 2020 23:18:14 +0100 cfingerd (1.4.3-3.2) unstable; urgency=medium @@ -13,14 +49,6 @@ -- Chris Lamb Sat, 24 Sep 2016 17:37:58 +0200 -cfingerd (1.4.3-3.1ubuntu1) raring; urgency=low - - * Merge from Debian unstable. Remaining changes: - - debian/control: Add openbsd-inetd | inet-superserver dependencies, - as cfingerd needs an inet server to work. - - -- Logan Rosen Tue, 26 Feb 2013 16:29:04 -0500 - cfingerd (1.4.3-3.1) unstable; urgency=high * Non-maintainer upload. @@ -30,22 +58,6 @@ -- Salvatore Bonaccorso Sat, 09 Feb 2013 18:38:28 +0100 -cfingerd (1.4.3-3ubuntu2) raring; urgency=high - - * SECURITY UPDATE: fix buffer overflow in rfc1413 (ident) client - (LP: #1104425). - - CVE-2013-1049 - - -- Malcolm Scott Thu, 24 Jan 2013 20:19:56 +0000 - -cfingerd (1.4.3-3ubuntu1) maverick; urgency=low - - * Merge from debian unstable. Remaining changes: LP: #600078 - - debian/control: Add openbsd-inetd | inet-superserver dependencies - as cfingerd needs an inet server to work - - -- Bhavani Shankar Wed, 30 Jun 2010 10:24:13 +0530 - cfingerd (1.4.3-3) unstable; urgency=low * Approve NMU @@ -54,14 +66,6 @@ -- Joey Schulze Sat, 19 Jun 2010 22:03:31 +0200 -cfingerd (1.4.3-2.1ubuntu1) jaunty; urgency=low - - * Merge from Debian unstable. Remaining Ubuntu changes: (LP: #295326) - - debian/control: Add openbsd-inetd | inet-superserver dependencies - as cfingerd needs an inet server to work - - -- David Futcher Tue, 21 Oct 2008 11:31:06 +0200 - cfingerd (1.4.3-2.1) unstable; urgency=medium * Non-maintainer upload. @@ -70,17 +74,6 @@ -- Chris Lamb Tue, 21 Oct 2008 00:10:05 +0100 -cfingerd (1.4.3-2ubuntu1) hardy; urgency=low - - * Merge from Debian unstable. (LP: #195865) Remaining Ubuntu changes: - - debian/control: Add update-inetd to cfingerd's dependencies - (Closes Ubuntu: #76480). - - debian/control: Add openbsd-inetd | inet-superserver dependencies - as cfingerd needs an inet server to work - * Modify Maintainer value to match Debian-Maintainer-Field Spec - - -- Stefan Ebner Tue, 26 Feb 2008 20:20:41 +0100 - cfingerd (1.4.3-2) unstable; urgency=low * Partially imported NMU @@ -98,15 +91,6 @@ -- Martin Schulze Mon, 25 Feb 2008 10:43:57 +0100 -cfingerd (1.4.3-1.2ubuntu1) feisty; urgency=low - - * debian/control: Add update-inetd to cfingerd's dependencies - (Closes Ubuntu: #76480). - * debian/control: Add openbsd-inetd | inet-superserver dependencies - as cfingerd needs an inet server to work - - -- Lionel Porcheron Sat, 16 Dec 2006 15:54:32 +0100 - cfingerd (1.4.3-1.2) unstable; urgency=low * Non-maintainer upload (RC bug more than 2 years old). @@ -173,7 +157,7 @@ -- Martin Schulze 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) @@ -183,7 +167,7 @@ -- Martin Schulze 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. @@ -192,14 +176,14 @@ -- Martin Schulze 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 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 @@ -208,7 +192,7 @@ -- Martin Schulze 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 @@ -235,21 +219,21 @@ -- Martin Schulze 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 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 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() @@ -282,13 +266,13 @@ -- John Goerzen 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 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) @@ -301,7 +285,7 @@ -- Martin Schulze 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) @@ -314,7 +298,7 @@ -- Martin Schulze 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 @@ -324,7 +308,7 @@ -- Martin Schulze 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) @@ -335,23 +319,23 @@ * Added patch to support Qmail mailboxes, thanks to Russell Coker * Updated manpage properly - + -- Martin Schulze 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 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 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 @@ -394,12 +378,12 @@ 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 Sun, 23 Feb 1997 12:21:29 +0100 cfingerd (1.3.0-1) unstable; urgency=low @@ -409,48 +393,74 @@ -- Martin Schulze Fri, 21 Feb 1997 08:56:45 +0100 Sat Sep 14 00:10:39 1996 Martin Schulze + * src/search.c: If the internal search.*@ is used the whole GCOS field won't be sent out anymore. + * Approved llucius' changes to compile under m68k as well (only removing -m486 from Makefiles). Thanks to Leeland Lucius for providing me with a patch. + * src/standard.c: Changed identification of MSG-N. Thanks to Joerg Kleuver who pointed me to the mistake and provided me with a fix. + * debian.rules: Merged Debian release and Infodrom release together. + Thu Jun 27 09:59:45 1996 Martin Schulze + * Edited Description field (thanks to Susan Kleinmann (sgk@sgk.tiac.net) + Wed Jun 12 23:37:32 1996 Martin Schulze + * changed description (Bug#3250) + Tue May 21 09:55:00 1996 Martin Schulze + * debian.rules: Corrected permission problem + Wed May 16 22:13:31 1996 Martin Schulze + * Added handling of user and group ids. Programs are called as nobody.nogroup, files are read with the same permissins, but user logfiles are written with user priviliges. Added privs.h - idea and source mostly taken from T-Rex' file. + Commented out odd checks about uid/euid. + Commented out unused routines become_nobody() and become_user(). + Wed May 15 20:05:53 1996 Martin Schulze + * Corrected local hostname. + * Modified the search.@ service to work properly, which wasn't the case before. + * Corrected the output of HEADER_FILE and FOOTER_FILE in some places, see diff-file for details. + * Altered the behaviour of NO_NAME_BANNER and NO_USER_BANNER. + * changed from /var/adm/{lastlog,wtmp} to /var/log/{lastlog,wtmp} in Configure script. + * Added special handling of forward requests: "Finger forwarding service denied." Added string variable to /etc/cfingerd.conf: FORWARD_DENY. + * Increased the size of syslog_str, becaus if it is too short username will be overwritten. + * Changed some manpages to fit into the Linux manpages structure. Changed some sections. + * Hostnames are no longer case-sensitive. + * Removed some options for userlist, because they're only confusing and not supported yet. + Wed May 5 13:20:21 1996 Martin Schulze - * Added Debian packaging files. + * Added Debian packaging files. diff -Nru cfingerd-1.4.3/debian/compat cfingerd-1.4.3/debian/compat --- cfingerd-1.4.3/debian/compat 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7 diff -Nru cfingerd-1.4.3/debian/control cfingerd-1.4.3/debian/control --- cfingerd-1.4.3/debian/control 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/debian/control 2021-02-05 14:40:24.000000000 +0000 @@ -1,10 +1,14 @@ Source: cfingerd Section: net -Priority: extra +Priority: optional Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Martin Schulze -Build-Depends: debhelper (>= 7) -Standards-Version: 3.8.4 +XSBC-Original-Maintainer: Debian QA Group +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 @@ -18,4 +22,3 @@ 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 -Nru cfingerd-1.4.3/debian/patches/fix_ftbfs.patch cfingerd-1.4.3/debian/patches/fix_ftbfs.patch --- cfingerd-1.4.3/debian/patches/fix_ftbfs.patch 1970-01-01 00:00:00.000000000 +0000 +++ cfingerd-1.4.3/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 +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 -Nru cfingerd-1.4.3/debian/patches/import_diff.patch cfingerd-1.4.3/debian/patches/import_diff.patch --- cfingerd-1.4.3/debian/patches/import_diff.patch 1970-01-01 00:00:00.000000000 +0000 +++ cfingerd-1.4.3/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 + - Shadow password testing + - Secure (NOBODY PATCH) finger help + +-cc@spork.neonexus.com ++David Muench + - Finger forwarding idea + + Rich Salz +@@ -76,3 +76,13 @@ Tadek Knapik + + Alexey M. Zelkin + - Support for FreeBSD ++ ++Kevin Rosenberg ++ - Get UTMP file entries for BSD compatibility ++ ++Thomas Koenig ++ - Management of e?uid switching ++ ++Lars Mathiesen ++ - 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 + # +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) 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 -Nru cfingerd-1.4.3/debian/patches/reproducible-build.patch cfingerd-1.4.3/debian/patches/reproducible-build.patch --- cfingerd-1.4.3/debian/patches/reproducible-build.patch 1970-01-01 00:00:00.000000000 +0000 +++ cfingerd-1.4.3/debian/patches/reproducible-build.patch 2020-09-23 11:12:44.000000000 +0000 @@ -0,0 +1,30 @@ +From: Chris Lamb +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 -Nru cfingerd-1.4.3/debian/patches/series cfingerd-1.4.3/debian/patches/series --- cfingerd-1.4.3/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ cfingerd-1.4.3/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 -Nru cfingerd-1.4.3/debian/rules cfingerd-1.4.3/debian/rules --- cfingerd-1.4.3/debian/rules 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/debian/rules 2020-09-23 11:12:44.000000000 +0000 @@ -19,10 +19,7 @@ # 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 @@ 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 @@ $(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 @@ $(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: 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 -Nru cfingerd-1.4.3/debian/source/format cfingerd-1.4.3/debian/source/format --- cfingerd-1.4.3/debian/source/format 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/debian/source/format 2020-09-23 11:12:44.000000000 +0000 @@ -1 +1 @@ -1.0 +3.0 (quilt) diff -Nru cfingerd-1.4.3/docs/cfingerd.8 cfingerd-1.4.3/docs/cfingerd.8 --- cfingerd-1.4.3/docs/cfingerd.8 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/docs/cfingerd.8 1999-09-04 22:39:28.000000000 +0000 @@ -33,7 +33,7 @@ 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 -Nru cfingerd-1.4.3/docs/cfingerd.conf.5 cfingerd-1.4.3/docs/cfingerd.conf.5 --- cfingerd-1.4.3/docs/cfingerd.conf.5 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/docs/cfingerd.conf.5 1999-09-04 22:39:28.000000000 +0000 @@ -8,8 +8,8 @@ .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 @@ 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 @@ 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 @@ 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 -Nru cfingerd-1.4.3/docs/cfingerd.text.5 cfingerd-1.4.3/docs/cfingerd.text.5 --- cfingerd-1.4.3/docs/cfingerd.text.5 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/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 -Nru cfingerd-1.4.3/Makefile.cfg.in cfingerd-1.4.3/Makefile.cfg.in --- cfingerd-1.4.3/Makefile.cfg.in 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/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 # diff -Nru cfingerd-1.4.3/perl/generic.pl cfingerd-1.4.3/perl/generic.pl --- cfingerd-1.4.3/perl/generic.pl 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/perl/generic.pl 1999-08-31 00:46:46.000000000 +0000 @@ -14,11 +14,6 @@ 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 -Nru cfingerd-1.4.3/RECOMMEND cfingerd-1.4.3/RECOMMEND --- cfingerd-1.4.3/RECOMMEND 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/RECOMMEND 1997-06-15 17:40:32.000000000 +0000 @@ -4,7 +4,7 @@ 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 -Nru cfingerd-1.4.3/src/cfingerd.h cfingerd-1.4.3/src/cfingerd.h --- cfingerd-1.4.3/src/cfingerd.h 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/src/cfingerd.h 1999-08-29 08:58:29.000000000 +0000 @@ -278,11 +278,10 @@ 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 @@ #include "defines.h" -#endif /* _CFINGERD_H_ */ +#endif _CFINGERD_H_ diff -Nru cfingerd-1.4.3/src/fakeuser.c cfingerd-1.4.3/src/fakeuser.c --- cfingerd-1.4.3/src/fakeuser.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/src/fakeuser.c 1999-09-29 07:04:24.000000000 +0000 @@ -79,7 +79,7 @@ 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 @@ 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 @@ } 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 -Nru cfingerd-1.4.3/src/internal.c cfingerd-1.4.3/src/internal.c --- cfingerd-1.4.3/src/internal.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/src/internal.c 1999-08-29 08:58:29.000000000 +0000 @@ -72,26 +72,26 @@ 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 -Nru cfingerd-1.4.3/src/log.c cfingerd-1.4.3/src/log.c --- cfingerd-1.4.3/src/log.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/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 @@ } 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 -Nru cfingerd-1.4.3/src/main.c cfingerd-1.4.3/src/main.c --- cfingerd-1.4.3/src/main.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/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 @@ 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ 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 -Nru cfingerd-1.4.3/src/parse.c cfingerd-1.4.3/src/parse.c --- cfingerd-1.4.3/src/parse.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/src/parse.c 1999-09-29 07:04:24.000000000 +0000 @@ -137,14 +137,14 @@ 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 -Nru cfingerd-1.4.3/src/proto.h cfingerd-1.4.3/src/proto.h --- cfingerd-1.4.3/src/proto.h 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/src/proto.h 1999-08-29 08:58:30.000000000 +0000 @@ -45,9 +45,9 @@ 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 -Nru cfingerd-1.4.3/src/rfc1413.c cfingerd-1.4.3/src/rfc1413.c --- cfingerd-1.4.3/src/rfc1413.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/src/rfc1413.c 1999-08-29 12:14:25.000000000 +0000 @@ -25,75 +25,45 @@ * 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 @@ if (*(++cp) == ' ') cp++; memset(uname, 0, sizeof(uname)); - for (xp=uname; *cp != '\0' && *cp!='\r'&&*cp!='\r'&&*cp!='\n'&&(strlen(uname)+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 -Nru cfingerd-1.4.3/src/version.c cfingerd-1.4.3/src/version.c --- cfingerd-1.4.3/src/version.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/src/version.c 1999-07-30 08:18:55.000000000 +0000 @@ -45,7 +45,7 @@ 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 -Nru cfingerd-1.4.3/userlist/display.c cfingerd-1.4.3/userlist/display.c --- cfingerd-1.4.3/userlist/display.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/userlist/display.c 1999-09-29 07:04:24.000000000 +0000 @@ -79,7 +79,7 @@ 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 @@ pwent = getpwnam((char *) ru); if (pwent) { - char *cp, *x; - cp = pwent->pw_gecos; if ((x = index (pwent->pw_gecos, ',')) != NULL) /* username */ *x = '\0'; diff -Nru cfingerd-1.4.3/userlist/idle.c cfingerd-1.4.3/userlist/idle.c --- cfingerd-1.4.3/userlist/idle.c 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/userlist/idle.c 1999-08-05 22:52:37.000000000 +0000 @@ -24,16 +24,10 @@ 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 @@ if (day) { if (no_idle) return NULL; - snprintf(idledisp, sizeof (idledisp), "%1dd", day); + snprintf(idledisp, sizeof (idledisp), "%1dd ", day); return idledisp; } diff -Nru cfingerd-1.4.3/userlist/userlist.1 cfingerd-1.4.3/userlist/userlist.1 --- cfingerd-1.4.3/userlist/userlist.1 2021-02-05 14:46:14.000000000 +0000 +++ cfingerd-1.4.3/userlist/userlist.1 1999-09-04 22:39:30.000000000 +0000 @@ -8,7 +8,7 @@ .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 @@ .B "\-c" Give standard CFINGERD (custom) output. .TP -.B "\-n" +.B. "\-n" List only people idle less than one day. .br .SH ADDITIONAL