Commit graph

146 commits

Author SHA1 Message Date
Ruslan Ermilov f682f10c76 Sync program's usage() with manpage's SYNOPSIS. 2005-05-21 09:55:10 +00:00
Ruslan Ermilov 6b806d21d1 Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
Ruslan Ermilov 6c7216df78 Sort sections. 2005-01-18 13:43:56 +00:00
Tim J. Robbins 3d1a01487a Document incorrect handling of multibyte characters. 2004-07-17 04:04:30 +00:00
Ruslan Ermilov 6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
Stefan Farfeleder a752604477 Remove spurious semicolons. Outside of functions they are actually errors but
GCC doesn't warn about them without -pedantic.

Approved by:	das (mentor)
PR:		56649
Reviewed by:	md5
2004-05-16 22:08:17 +00:00
Juli Mallett 8714ee5954 Add multiple inclusion guards. Mostly this is for extern.h, which was
included twice by lprint.c, which included both finger.h and extern.h.
finger.h, in turn, includes extern.h.  The redundant include of extern.h
was removed from lprint.c, as part of this change, but the include guards
were added anyway out of spite.
2004-03-14 06:43:34 +00:00
Bruce Evans f342fec625 Fixed a misspelling of 0 as NULL. 2004-03-14 05:51:20 +00:00
Juli Mallett ad46866975 Add code to keep going if you're really intent on fingering someone, but
can't use utmp(5).
2003-06-28 23:11:41 +00:00
Robert Watson 7d7d429762 If stat() on the terminal specified in utmp fails due to ENOENT, don't
print a warning, and set the idletime variable for the entry to -1;
then pick up the -1 later in sprint() and lprint() and ignore those
idle times by printing just whitespace.  When third party applications,
such as kdm, insert utmp entries, they sometimes use strings like ":0",
which can't be stat()'d and currently result in warnings that are
not helpful to the user.
2003-04-02 20:22:29 +00:00
Ruslan Ermilov facc67676f mdoc(7) police: Deal with self-xrefs. 2002-12-24 13:41:48 +00:00
Peter Pentchev 8c9589bdea Make a CR/LF sequence measure up to its name: the order of the CR and LF
characters was reversed, resulting in some network appliances, including
at least some NAS devices from Ascend, not recognizing our finger(1)
request.

PR:		45914
Submitted by:	J R Matthews <jrm@delta-e.com.au>
Approved by:	re (rwatson)
MFC after:	2 weeks
2002-12-02 20:38:12 +00:00
Ruslan Ermilov fc978ec46c mdoc(7) police: bump document date, use the canonical option list width,
removed a bunch of extraneous .Pp and .Dq calls.

Approved by:	re
2002-11-26 11:09:27 +00:00
Maxim Sobolev 1acb5329c8 Back out previous commit - it was not well thought out.
Clue beaten in by:	ume
Pointy hat to:		sobomax
2002-10-31 13:05:56 +00:00
Maxim Sobolev ef1e4234eb Fix POLA breakage in 1.29: IPv4 should be default. This makes `-4' option
a nop, but we'll probably want to keep it for compatibility with other
KAME-based systems.

Complained about by:	Andrey Lakhno <land@dnepr.net>
MFC after:		3 days
2002-10-31 10:36:12 +00:00
David Malone f4ac32def2 ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by:	md5
2002-09-04 23:29:10 +00:00
Hajimu UMEMOTO 3daa847108 add -4 and -6 option to be able to specify an address family.
Requested by:	matusita
MFC after:	1 week
2002-07-22 17:19:54 +00:00
Jonathan Mini 0830bd135e Add -g option, which restricts printing of the gecos fields to just the user's
real name.

PR:		bin/39462
Submitted by:	Mike Makonnen <makonnen@pacbell.net>
Obtained from:	NetBSD
MFC after:	1 week
2002-07-02 08:00:20 +00:00
Juli Mallett 47bca8b02c Clean up malloc(3)'s argument. Remove casts which do nothing when we're
using sizeof() anyway.  Use slightly more consistent (per-file) error
reporting for malloc(3) returning NULL.  If "malloc failed" was being printed,
don't use err(3).  If a NULL format is being used, use err(3).  In one case
errx(3) was being used with strerror(3), so just use err(3).
2002-05-17 05:11:07 +00:00
Philippe Charnier 3898680cf7 Use `The .Nm utility' 2002-04-19 23:44:58 +00:00
Warner Losh f1bb2cd2aa remove __P 2002-03-22 01:22:50 +00:00
Bruce Evans 724f76029d Unremoved used includes. <sys/time.h> is needed if <sys/stat.h> isn't
polluted, and <sys/types.h> is strictly a prerequisite for <sys/stat.h>
untiil we drop support for pre-2001 versions of POSIX.
2002-02-25 05:09:12 +00:00
Mark Murray 91bd71d206 Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
Peter Wemm 77dcd09d42 GRR. Unbreak WARNS=2.
cc1: warnings being treated as errors
usr.bin/finger/lprint.c: In function `lprint':
usr.bin/finger/lprint.c:191: warning: precision is not type int (arg 2)
*** Error code 1

Pointy hat to:	markm
2002-02-08 07:52:51 +00:00
David Malone 9f5b04e925 Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.
2001-12-10 21:13:08 +00:00
Mark Murray 4e030ba6cb WARNS=2 fix, remove 'register' and use __FBSDID(). 2001-12-02 20:13:42 +00:00
Yaroslav Tykhiy d691b79fbc Replace the condemned access(2) by stat(2),
as per the discussion in -audit.
2001-08-08 21:22:48 +00:00
Yaroslav Tykhiy b95dbabab3 Don't use ".nofinger" as a string constant from within the code
since there is the ``pathnames.h'' file; use _PATH_NOFINGER instead.
2001-07-30 16:50:47 +00:00
Ruslan Ermilov 625003720a mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 14:16:33 +00:00
Ruslan Ermilov 5521ff5a4d mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2). 2001-07-06 16:46:48 +00:00
Dima Dorfman 7a19d1bbb9 Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).
2001-06-24 19:50:42 +00:00
Ruslan Ermilov dc12be5258 MAN[1-9] -> MAN. 2001-03-27 10:52:19 +00:00
Andrey A. Chernov f4d292b799 Don't attempt to parse %c 2001-03-21 18:43:49 +00:00
Warner Losh 167ea27b4f MAXPATHLEN is enough.
Also, snprinf is guaranteed by the new ansi standard to NUL terminate the
string, so we don't need to do that ourselves.
2001-03-01 05:52:38 +00:00
Philippe Charnier 4c86f3ad84 Spelling
Remove unused #includes
2001-02-06 20:13:48 +00:00
Chris D. Faulhaber 8728c621a0 Check strdup() return values
Reviewed by:	kris
2001-01-20 00:26:32 +00:00
Dag-Erling Smørgrav a6115eb2f8 .publickey -> .pubkey to match other finger daemons.
Suggested by:	assar
2001-01-04 10:03:44 +00:00
Dag-Erling Smørgrav d17485b639 Add support for a .publickey file.
Submitted by:	Svein Skogen <tds@nsn.no>
Reviewed by:	brian, ru
2000-12-29 11:39:25 +00:00
Brian Somers 3bebe99135 If the utmp login time is greater than the tty atime, use it to calculate
the idle time instead of the atime.

This makes entries for people that have logged in but done nothing
else show up correctly.

Reviewed by: markk@knigma.org
2000-12-21 01:30:47 +00:00
Ruslan Ermilov 9b88faecd3 Prepare for mdoc(7)NG. 2000-12-19 16:00:12 +00:00
Ruslan Ermilov 52e5cddf31 Document what Idle=* means in a short format display. 2000-12-12 13:37:34 +00:00
Ruslan Ermilov 8fe908ef0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
Ruslan Ermilov cf040f7474 The -o is the default for "short" display, not the -h. 2000-10-24 08:47:07 +00:00
Ruslan Ermilov 1e832bf81d -Wall cleanup.
PR:		22187
2000-10-23 12:18:34 +00:00
Ruslan Ermilov 0272ef9b3e Do not allow `finger -m /somefile' as well. 2000-10-05 15:56:13 +00:00
Brian Somers 7ce8924adb Don't allow finger /somefile, only allow filname expansions from
inside /etc/finger.conf

PR:	21704
2000-10-02 22:27:34 +00:00
Garrett Wollman 2804330f1a Don't assume ai0->ai_canonname will always be filled in. Print the
user-supplied host name if we can't get a canonical name.

Obtained from:	contrib/tcp_wrappers/socket.c rev. 1.4 (in spirit)
2000-09-24 01:54:49 +00:00
Garrett Wollman e45ccde7c6 Implement IPv6 support. Also restructure the way multi-homed hosts
are treated, regardless of protocol.
2000-09-22 01:06:40 +00:00
Garrett Wollman a1d399d2ed Delete a bogus reference to T/TCP -- the problem still exists on Standard
TCP.
2000-09-22 01:04:59 +00:00
Brian Somers 1b57e36589 Don't drop out when we've processed argc - 1 names.... arguments
may expand to more than one user.

PR:	21228
2000-09-12 21:58:31 +00:00
Brian Somers 78be7a111a Finger.conf first appeared in 4.2 (now that it's been MFCd) 2000-08-25 22:22:04 +00:00
Brian Somers 475f25ebaf Fix the -m option - broken by the last commit.
Submitted by:	Mark Knight <markk@knigma.org>
2000-08-25 18:28:43 +00:00
Sheldon Hearn 909aa0d5b9 Add a missing comma. 2000-08-25 08:29:28 +00:00
Brian Somers 040864ac7a Allow finger.conf to contain aliases for files that will be displayed
when fingered.

Submitted by: Mark Knight <markk@knigma.org>
2000-08-25 01:01:07 +00:00
Sheldon Hearn 2087b4533a Remove extraneous arguments to the Os (operating system) and Nm
(name) macros.

Do not terminate the cross-reference list in the SEE ALSO section
with a period.
2000-08-17 16:57:31 +00:00
Brian Somers 098c6e8747 Allow a /etc/finger.conf file that contains finger aliases
This allows people who's email address differs from their account name
to be fingerable.

Submitted by: Mark Knight <markk@knigma.org>
2000-08-17 10:59:17 +00:00
Jeroen Ruigrok van der Werven d70eeca360 Backout previous commit.
(Mental note: don't forget -rRELENG_4 next time.)
2000-07-12 09:50:20 +00:00
Jeroen Ruigrok van der Werven ae67045f8e MFC: fix some output cosmetics so that the finger -s output is properly
lined up
2000-07-12 08:50:09 +00:00
Jeroen Ruigrok van der Werven 28035b8ba8 Fix finger -s output on an user who never logged in.
This is purely a cosmetic patch.

PR:		9809
Submitted by:	se
Nagged about:	nrahlstr
2000-07-11 08:37:56 +00:00
Kris Kennaway 084c79f69e Don't call warn() with no format string. 2000-07-10 08:49:28 +00:00
Sheldon Hearn 87faa07bec Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 12:20:22 +00:00
Peter Wemm c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Warner Losh b59bb23b3d Use the final version of the patch for the overflow, not the next to
final.

Noticed by: eivind
1999-08-22 17:24:25 +00:00
Warner Losh e0d8eea175 Fix possible buffer overflow with finger and fingerd.
Submitted by: Lukasz Luzar <lluzar@noname.kki.krakow.pl> and
	Eivind Eklund <eivind@yes.no>

This patch is actually a combination of those two patches.
1999-08-21 18:25:38 +00:00
Bill Fumerola 9ef5c48bef Clean up some ambiguous nested if/elses. 1999-07-04 17:26:16 +00:00
David E. O'Brien dd5288f3a5 Impliment elements of TCP Wrappers's `safe_finger'.
* if run by root (or root process) drop privs
* ensure output size is not infinate (net finger only)
* ensure output lines are not infinate in length (net finger only)
* do not allow finger client to run longer than 3 minutes (net finger only)
1999-05-08 00:46:06 +00:00
Andrey A. Chernov b4689cd667 fix 8bit clean issue
PR: 7519
1998-08-07 16:21:09 +00:00
Warner Losh a716ad6693 Don't assume that hp->h_lenght == 4. Be conservative in its use.
Submitted by:	 J. Assange a long time ago.
1998-06-09 04:31:02 +00:00
Garrett Wollman 4c33feed58 Document the bogus standard requirement of delaying the close.
Also include a reference to the FINGER RFC.
1997-08-01 20:26:47 +00:00
Garrett Wollman a32cbefa87 So somebody actually found language in the FINGER RFC which requires
implementations to leave the client side open until the server closes.
While this is totally idiotic, it seems as if some servers actually require
it (e.g., the one at mit.mit.edu).  So, we bow to the weight of the bogus
standard and disable the initial close.  Hopefully now fetch(1) can serve
the role of T/TCP demonstration application.
1997-08-01 20:10:44 +00:00
Philippe Charnier b14d8277cc Add rcsid, usage(). Silent -Wall. Use warn(3). 1997-07-02 06:34:51 +00:00
Warner Losh 1c8af87873 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
Andrey A. Chernov 3429a30406 Skip \r character while printing Plan/etc. text files, it allows to
handle \r\n and \n\r files properly.
Previous variant put ^M for \r\n and ^M\n for \n\r
1997-03-17 17:07:39 +00:00
Peter Wemm df3f5d9dd5 Merge from Lite2 1997-03-11 13:43:33 +00:00
Peter Wemm 18dac96b7b This commit was generated by cvs2svn to compensate for changes in r23690,
which included commits to RCS files with non-trunk default branches.
1997-03-11 13:08:12 +00:00
Peter Wemm 0da30e9aa7 Import some parts of CSRG 4.4BSD-Lite2 usr.bin sources to fix tree build. 1997-03-11 13:08:12 +00:00
Andrey A. Chernov 5b3675170f Adjust line to not overflow 80 cols (result of recent utmp changes) 1996-12-05 17:33:46 +00:00
Andras Olah 03801815df Allow the user to disable the use of T/TCP by setting the -T option.
This option becomes useless when all TCP stacks are fixed out there.
1996-03-15 16:41:49 +00:00
Andrey A. Chernov a0a4788922 Print 8bit chars from the net if current locale allows them 1996-03-10 23:33:48 +00:00
Garrett Wollman 1e474c62ca Implement client-side transaction TCP. This has little effect
if the server doesn't support it.  (This is intended mostly as
an example.)
1995-12-17 21:04:36 +00:00
Andrey A. Chernov d1b2ad1a54 Change locale to LC_ALL, there is no bitmask 1995-10-26 11:03:08 +00:00
Andrey A. Chernov dc675fc2e7 Add setlocale LC_TIME|LC_CTYPE 1995-10-24 04:18:45 +00:00
Peter Wemm 39c17c43c5 Reverse out some of the previous commit I did, which shortened the
finger output from 80 to 79 characters to stop the syscons
every-second-line-is-blank problem.

Also, redo the TTY column mod so that it steals one of the (usually) two
blank spaces from the before the tty column rather than from the office
phone number.

This means the office phone field width in the short finger is back to 15
characters instead of 13.
1995-10-10 02:31:09 +00:00
Peter Wemm 6926792029 Increase the tty column width from 2 to 3 characters.
This gives us more room to breath with tty names, especially with drivers
that support large numbers of ports..  eg: specialix and digiboard.

This does not actually change the current tty names, it just allows room
for reporting more characters if the drivers use them.
1995-09-04 01:22:54 +00:00
Andrey A. Chernov d40cee33a8 Allow national printable chars in .plan 1995-08-08 00:45:21 +00:00
Andrey A. Chernov 7a88bad16a Replace asctime/ctime by strftime %c to use national representation 1995-08-08 00:38:33 +00:00
Garrett Wollman 656dcd4316 Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
1995-08-07 19:17:46 +00:00
Andrey A. Chernov c2ac9540cd Fix finger not check all users ~/.nofinger, only for actually
matched. Close PR 539
Submitted by: tom@haven.uniserve.com
1995-06-21 23:54:43 +00:00
Rodney W. Grimes 7799f52a32 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
Joerg Wunsch b2b31a1c92 Make finger(1) accept "cua" to be also a tty, and use the suffix instead
of the very meaningful string "cu" to describe the tty.
1995-03-25 18:15:40 +00:00
Jordan K. Hubbard 8829c73eb6 Add Sean Eric Fagan's support for a ~/.nofinger file for user who prefer
their privacy.
Submitted by:	sef
1995-01-04 01:02:43 +00:00
Paul Traina a5af661e23 Remove extra newline introduced in 44lite (oops) 1994-12-05 10:01:39 +00:00
Paul Traina 2e8df940be Remove extra newline introduced in Net/2 1994-12-05 10:01:23 +00:00
Paul Traina 59be608802 Add code to pull options out of FINGER environment variable if present.
Yes, has same stupid bug as more(1), options must be specified as one
argument.

Submitted by:	pst
1994-09-08 19:27:06 +00:00
Paul Traina 86641d8f9c Install Luke's enhancements for finger.
By default, behave like the old ugly 4.4bsd finger and print office
information instead of remote login information.

It's an easy one line fix to make it behave like most other vendor's
fingers if we decide to change the default.

Reviewed by:	pst
1994-09-07 07:22:41 +00:00
Rodney W. Grimes 9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00