Commit Graph

49 Commits

Author SHA1 Message Date
Pedro F. Giffuni
8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Stephen J. Kiernan
ee27b3cd98 The variable nargv is allocated but never freed, so free it when the it
is no longer used.

Submitted by:	Thomas Rix <trix@juniper.net>
Reviewed by:	ed
Approved by:	sjg (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9652
2017-06-13 15:50:16 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Ed Schouten
bf70becee6 More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49: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
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
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
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
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
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
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
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
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
Warner Losh
f1bb2cd2aa remove __P 2002-03-22 01:22:50 +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
Andrey A. Chernov
f4d292b799 Don't attempt to parse %c 2001-03-21 18:43:49 +00:00
Philippe Charnier
4c86f3ad84 Spelling
Remove unused #includes
2001-02-06 20:13:48 +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
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
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
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
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
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +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
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
Peter Wemm
df3f5d9dd5 Merge from Lite2 1997-03-11 13:43:33 +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
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
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
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
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