Commit Graph

14 Commits

Author SHA1 Message Date
Ed Schouten
d7f1607c6a Chop off excessive long hostnames to keep the table structure intact.
This makes lastlogin(8) use exactly the same printf format as last(1).
2010-03-20 09:29:25 +00:00
Ed Schouten
3c247358fe Remove unneeded setpassent() calls.
lastlogin no longer requires the use of the passwd database.
2010-01-24 14:29:40 +00:00
Ed Schouten
b5207b31c4 Port lastlogin(8) to utmpx.
While there, fix a bug I introduced previously. We must reopen the
database for each username passed on the command line. We must rewind
the database and search from the beginning.
2010-01-13 18:17:12 +00:00
Ed Schouten
10bc3a7f42 ANSIfy almost all applications that use WARNS=6.
I was considering committing all these patches one by one, but as
discussed with brooks@, there is no need to do this. If we ever
need/want to merge these changes back, it is still possible to do this
per application.
2009-12-29 22:53:27 +00:00
Ed Schouten
444999a314 Several refinements to libulog's API.
- Only set the fields in the ulog_utmpx structure that are valid for the
  command in question. This means that strings like "shutdown" or "~"
  are not visible to the user anymore.
- Rename UTXF_* to UTXI_*, indicating the indexation, instead of using
  the `antique' filename. If we ever get rid of utmp, it makes little
  sense calling it by its old name.
2009-12-26 22:36:05 +00:00
Ed Schouten
b486f60642 Port lastlogin(1) to libulog.
Just use ulog_getutxuser() to obtain lastlog records or ulog_getutxent()
to browse through all of them.
2009-12-09 20:05:37 +00:00
Alfred Perlstein
d89167b4ea de-__P() 2002-07-11 18:31:16 +00:00
Bruce Evans
db774d6099 Fixed some world breakage caused by not updating clients when <timeconv.h>
was split off from <time.h>.  This became fatal here when -Werror was
reenabled.
2002-07-08 20:13:07 +00:00
Mike Barcroft
6a85a2d149 Don't depend on <pwd.h> to bogusly include <sys/types.h>. 2002-06-09 19:29:55 +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
5e8a6141be Fix ctime(&int) due to change to lastlog->ll_time 2001-10-29 00:40:05 +00:00
Dima Dorfman
c869717158 Include stdlib.h for exit(3).
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-06-24 20:05:30 +00:00
Philippe Charnier
fdd5d777dc Remove unused #includes, duplicate $FreeBSD$ and $NetBSD$ definitions.
Reviewed by:	Ruslan Ermilov <ru@FreeBSD.org>
2000-12-10 20:57:23 +00:00
Ruslan Ermilov
b3b01ff362 Added the lastlogin utility.
Obtained from:	NetBSD
2000-11-14 17:49:38 +00:00