Commit Graph

56 Commits

Author SHA1 Message Date
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
Ruslan Ermilov
756ceae899 mdoc(7) police: add missing .Ar in SYNOPSIS. 2001-07-05 06:20:29 +00:00
Dima Dorfman
92b401e824 Silence warnings and minor style fixes. Mostly constify and don't
assume that time_t is a long.  Clamp down with WARNS=2.

Not objected to by:	-audit
2001-06-14 04:55:26 +00:00
Ruslan Ermilov
f82078861c The last(1) choked if there were two successive "login" marks
found in wtmp(5) for the same TTY without in-between "logout"
mark.

This may be demonstrated by executing login(1), logging in and
out, and watching the last(1) output on this TTY:

: # last -tv7 -w
: ru      ttyv7              Mon May 28 12:46 - 12:46  (00:00:01)
: ru      ttyv7              Mon May 28 12:45   still logged in

The fix merely takes the second "login" mark as the "logout" for
the first "login" mark, if there were no "logout" mark in-between.
This restores the behavior of last.c,v 1.2:

: # last -tv7 -w
: ru      ttyv7              Mon May 28 12:46 - 12:46  (00:00:01)
: ru      ttyv7              Mon May 28 12:45 - 12:46  (00:00:25)

Silence from:	-arch, dg
2001-05-28 09:57:19 +00:00
Dima Dorfman
8a24285612 Implement snapshots. The new -d option allows the user to find out
who was logged in at a certain time and date.

Obtained from:	OpenBSD
2001-05-28 01:22:37 +00:00
Dima Dorfman
ea0aee1233 mdoc(7) police: remove hard sentence breaks. 2001-04-26 06:10:46 +00:00
Andrey A. Chernov
a99768c6e2 Don't attempt to parse %c 2001-03-21 19:08:01 +00:00
Poul-Henning Kamp
4ea7b32b35 Used macro-API to <sys/queue.h>.
Submitted by:	ben
2000-12-29 09:27:57 +00:00
Ruslan Ermilov
8fe908ef0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
Warner Losh
62f882d620 getopt and friends are declared in <unistd.h>
getopt returns -1 not EOF.
2000-09-04 06:09:54 +00:00
Kris Kennaway
612740bdcf Don't call printf with no format string. 2000-07-10 06:02:13 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +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
Nik Clayton
3be5f1f5ce Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:24:20 +00:00
Daniel O'Callaghan
e72acbba84 Reviewed by: Peter Hawkins <thepish@FreeBSD.org>
Add s and w flags to show duration in or with seconds.
1998-05-28 00:58:29 +00:00
John Birrell
17ce12487f Change variable from long to time_t where they are passed by reference
to time().
1998-05-15 12:28:43 +00:00
Steve Price
7c50fe7bb0 Add the year to the 'wtmp begins...' line.
PR:		6421
Submitted by:	phk
1998-05-03 23:19:15 +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