Commit Graph

117 Commits

Author SHA1 Message Date
Eitan Adler
eae8be706e Bump date missed in r202756
PR:		docs/171624
Submitted by:	bdrewery
Approved by:	gabor
MFC after:	3 days
2012-09-14 17:50:42 +00:00
Ed Schouten
b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Ulrich Spörlein
487ac9ac21 Spelling fixes for usr.bin/ 2011-12-30 11:02:40 +00:00
Ed Schouten
c5d693c5d0 Build finger(1) with WARNS=6. 2011-10-14 07:24:23 +00:00
Xin LI
cde9717b67 Staticify cleanup() which is not referenced in other places.
MFC after:	2 weeks
2011-06-21 20:33:55 +00:00
Simon L. B. Nielsen
6e46c1cc7d Check return code of setuid() and setgid() in finger.
While they will not fail in normal circumstances, better safe than
sorry.

MFC after:	1 week
2011-04-23 14:19:26 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Ed Schouten
0806dd9238 Remove stale references to utmp(5) and its corresponding filenames.
I removed utmp and its manpage, but not other manpages referring to it.
2010-01-21 17:25:12 +00:00
Ed Schouten
550dcc5960 Migrate finger(1) towards utmpx.
It was already ported to use libulog, which makes it simpler now. Be
sure to catch the error returned by setutxdb(). Otherwise it may perform
a lookup on the utx.active database.
2010-01-13 17:50:58 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ed Schouten
70ad88f354 Migrate finger(1) away from <utmp.h>.
Unfortunately it also uses lastlog, which means we must resort to local
extensions of the utmpx-interface. Because the user name and TTY name
are now nul-terminated, there is no need to copy around strings as
often.
2009-12-28 20:54:34 +00:00
Xin LI
13cf266e82 Plug a memory leak.
PR:		bin/141836
Submitted by:	Henning Petersen <henning.petersen at t-online.de>
MFC after:	2 weeks
2009-12-21 19:15:30 +00:00
Xin LI
821df508e8 Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
Xin LI
6f2d322192 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
Ruslan Ermilov
1e5f1c29ea Restore the ".Sh BUGS" line that was accidentally removed
in the previous commit.
2007-04-12 08:22:49 +00:00
Dag-Erling Smørgrav
ae16dc8817 Remove irrelevant comment about T/TCP in BUGS.
Spotted by:	ru@
2007-04-11 20:32:59 +00:00
Dag-Erling Smørgrav
b49339d790 Remove -T from getopt() spec and usage string.
Submitted by:	ru@
2007-04-11 20:32:09 +00:00
Dag-Erling Smørgrav
e705dbe22c Bump Dd. 2007-04-11 19:20:42 +00:00
Dag-Erling Smørgrav
f8871cc86d Remove T/TCP support, and the -T option which was needed to disable it.
MFC after:	3 weeks
2007-04-11 19:11:54 +00:00
Robert Watson
e0f5d997de Reduce number of spaces for full name by four, and reduce padding
after tty entry by one space in order to provide extra spaces for
the tty entry.  As a result, full pts names are now visible (up
to 999 pts's anyway):

Before:
Login            Name                 TTY  Idle  Login  Time   Office  Phone
robert           Robert Watson       *v0   3:55  Fri    02:54
robert           Robert Watson        p0     19  Sat    11:01
robert           Robert Watson        pts        Sat    14:55

After:

Login            Name             TTY      Idle  Login  Time   Office  Phone
robert           Robert Watson   *v0       5:08  Fri    02:54
robert           Robert Watson    p0          8  Sat    11:01
robert           Robert Watson    pts/5          Sat    14:55

MFC after:	1 week
2006-03-04 16:13:16 +00:00
Diomidis Spinellis
d2e4ea2a51 Setting .nofinger will not hide you from root. 2005-09-19 10:11:47 +00:00
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