Commit Graph

75 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
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Stephen J. Kiernan
e2005cef7f Fix a memory leak with last
free memory allocated to 'buf'

Submitted by:	Thomas Rix <trix@juniper.net>
Reviewed by:	ed
Approved by:	sjg (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9850
2017-06-02 20:25:25 +00:00
Bryan Drewery
07676084ec DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-05-09 01:48:23 +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
Conrad Meyer
941e22d17d Capsicumify last(1)
Reviewed by:	ed (earlier version), emaste (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8001
2016-12-16 01:47:08 +00:00
Ed Schouten
46e834d780 Unbreak "last reboot".
According to the last(1) man page, the "reboot" pseudo-user should print
all system reboot entries. This got broken by the utmpx import, as
records are typed.

Re-add support for "last reboot" by specifically matching against
SHUTDOWN_TIME and BOOT_TIME records.

PR:		168844
Submitted by:	matthew@
MFC after:	1 month
2015-07-21 10:52:05 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Baptiste Daroussin
490f43697b Fix history, add AUTHORS section
Obtained from:	OpenBSD (by schwarze@)
2015-06-06 12:04:38 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Joel Dahl
914f6e6290 mdoc: sort SEE ALSO. 2014-12-26 21:56:23 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
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
8f8f476390 Switch batch to an SLIST.
This code requires none of the features of LIST.
2012-09-12 22:16:31 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Hiroki Sato
9549f74201 - Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp.
- A real filename is now shown in an output report when "-f file" is specified.
- Add Xr lastlogin into last(1) manual page.

Reviewed by:	ed
MFC after:	1 week
2012-01-22 11:34:24 +00:00
Ed Schouten
7f3271b68c Add missing static keywords to last(1) 2011-11-06 08:15:41 +00:00
Ed Schouten
51b671f6de Build last(1) and leave(1) with WARNS=6.
These ports were only built with WARNS=1, because they use certain
format extensions. We can use NO_WFORMAT for that instead.
2011-10-14 07:26:20 +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
6628ca0a98 Make last(1) display the full log file.
I must have misread when I ported the original last(1) source code.
Instead of only processing the last 1024 entries, it reads them in in
chucks of 1024 entries at a time.

Unfortunately we cannot walk through the log file in reverse order,
which means we have to allocate a piece of memory to hold all the
entries. Call realloc() for each 128 entries we read.

Reported by:	Andrzej Tobola <ato iem pw edu pl>
2010-01-19 19:53:05 +00:00
Ed Schouten
561f61e25d Port last(1) to use utmpx.
Basically there are three major things I changed about last(1):

- It should use ut_type instead of determining by hand what type of
  record was given.
- It should now keep track of ut_id's instead of TTYs. This means the
  ttylist has been renamed to the idlist, storing all the ut_id's it has
  processed until the next reboot.
- I've removed the signal handler. Because our wtmp is rotated so often,
  it makes little sense. Even on a simple piece of hardware it should be
  capable of grinding through megabytes of logs in a second.
2010-01-13 18:06:31 +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
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
6c7216df78 Sort sections. 2005-01-18 13:43:56 +00:00
David Malone
7e6990487d s/FALLTHOUGH/FALLTHROUGH/
Submitted by:	Xin LI <delphij@frontfree.net>
2004-08-08 18:59:19 +00:00
David Malone
baa8d9176f Include timeconv.h for _int_to_time and _time_to_int. 2004-02-15 21:52:59 +00:00
Tim J. Robbins
a3092ad9c2 Tidy up synopsis. 2003-08-17 10:24:53 +00:00
Tim J. Robbins
3293332416 Tidy up usage message. 2003-08-17 10:21:19 +00:00
Tim J. Robbins
b28e089684 Add the -n maxrec option as an alias for -maxrec for compatibility with
System V and consistency with other utilities. Document the new form
instead of the old form in the manual page.

PR:		54661
2003-07-27 10:53:28 +00:00
Maxime Henrion
4fd036fdbe Fix core dumps when invoking with something like ``last -w1''.
PR:		bin/44583
Reported by:	Amit Chakradeo <sdbug@spam.chakradeo.net>
MFC after:	3 days
2002-10-30 18:19:59 +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
Philippe Charnier
53aa54b8bf s/A last utility last appeared/A last utility appeared/ (horikawa).
Use .Pa for wtmp.

Submitted by:	horikawa
2002-07-21 12:45:54 +00:00
David E. O'Brien
e026a48c34 Consistently use FBSDID 2002-06-30 05:25:07 +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
e8937ba009 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
Warner Losh
f1bb2cd2aa remove __P 2002-03-22 01:22:50 +00:00
Ian Dowse
139db33f22 Add a new "-y" flag which causes the year to be included in the
session start time. This is useful when looking at old or long-running
wtmp files.

PR:		bin/12982
Obtained from:	KOJIMA Hajime <kjm@rins.ryukoku.ac.jp>, keramida
Reviewed by:	keramida
MFC after:	1 week
2002-03-01 21:12:19 +00:00
Ian Dowse
2e7a4024ff Oops, unbreak the -d and -<n> options. The `snapfound' variable
needs to be retained across entries, and we need to exit(), not
return from doentry() when `maxrec' reaches 0. Move the code for
processing `maxrec' into printentry() for simplicity.
2002-03-01 19:46:20 +00:00
Ian Dowse
6e3a7c4b1b Split up the big wtmp() function to avoid long lines and code
duplication.
2002-03-01 17:37:06 +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
Matthew Dillon
170ac683f2 I've been meaning to do this for a while. Add an underscore to the
time_to_xxx() and xxx_to_time() functions.  e.g. _time_to_xxx()
instead of time_to_xxx(), to make it more obvious that these are
stopgap functions & placemarkers and not meant to create a defacto
standard.  They will eventually be replaced when a real standard
comes out of committee.
2002-01-19 23:20:02 +00:00
Matthew Dillon
5fb4dbe1a0 localtime() was being called on an int pointer (due to recent
utmp-related commits).  fixed.
2001-10-29 00:34:20 +00:00
Dima Dorfman
e632521c36 Document -d in usage.
Submitted by:	Martin Kammerhofer <mkamm@sbox.tu-graz.ac.at>
2001-08-05 16:01:34 +00:00
Ruslan Ermilov
625003720a mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 14:16:33 +00:00