aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/last
Commit message (Collapse)AuthorAgeFilesLines
* last: Mild style cleanupDag-Erling Smørgrav2025-08-121-15/+12
| | | | | | | | | | * Prefer explicit NULL comparisons to using pointers as booleans * Prefer explicit 0 comparisons to using strcmp() as a predicate * Avoid use of strcpy() Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51876
* manpages: prefer linking to xo_options.7 over xo_parse_args.3Alan Somers2025-07-161-3/+3
| | | | | | | | | | | | | | | Most libxo-enabled utilities link to xo_parse_args.3. But that man page doesn't actually describe how to format command-line arguments. Rather, xo_options.7 does. I suspect that these utilities link to the former because the latter man page did not exist until libxo-0.7.2 (8a6eceff3ce). And newer utilities have probably been copy/pasting the same text from older ones. But the superior man page does exist now, so we should link to it instead. MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51354
* last(1): Complete libxo transitionYan-Hao Wang2024-10-121-11/+20
| | | | | | Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41424
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-7/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-273-6/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+2
|
* last(1): Remove double words in source code commentsGordon Bergling2023-04-181-1/+1
| | | | | | | - s/on on/on/ - s/we we/we/ MFC after: 5 days
* pkgbase: Put accounting utilities in the acct packageEmmanuel Vadot2022-08-161-0/+1
|
* last: improve non-UTF8 locale output after libxo support was addedPiotr Pawel Stefaniak2021-10-111-2/+2
| | | | | | | | | Some strftime(3) conversion specifications will generate strings encoded with the current locale, not necessarily UTF8. As per xo_format.5, use the h string modifier so that libxo interprets it appropriately. Reviewed by: eugen, philip Differential Revision: https://reviews.freebsd.org/D32437
* Revert "last(1): unbreak for 8-bit locales"Piotr Pawel Stefaniak2021-10-111-37/+5
| | | | | | | | | | | This reverts commits 8e67c427b5 (unbreak for 8-bit locales), 0ca58ca151 (correction after r351413), and f424ec1b80 (fix style after r351459). A simpler fix can be done by using the h modifier for strings that are encoded with the current locale. Reviewed by: eugen, philip Differential Revision: https://reviews.freebsd.org/D32437
* last(1): Add EXAMPLES sectionFernando ApesteguĂ­a2021-01-091-4/+22
| | | | | | | | | | | Add two simple examples showing the use of the flags: d, n, s, t While here, reorder cross references properly by section Bump .Dd Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D27540 last(1): Bump .Dd
* last(1): fix style after r351459Eugene Grosbein2019-08-251-1/+1
| | | | | | | | | Reported by: cem MFC after: 2 weeks X-MFC-With: 351459 Notes: svn path=/head/; revision=351467
* last(1): correction after r351413Eugene Grosbein2019-08-241-3/+5
| | | | | | | | | | | Make that change no-op for C/POSIX locale just like for UTF-8 that it superset of US-ASCII. MFC after: 2 weeks X-MFC-With: r351413 Notes: svn path=/head/; revision=351459
* last(1): unbreak for 8-bit localesEugene Grosbein2019-08-231-5/+35
| | | | | | | | | | | | | | | | Ouput format of last(1) is broken for non UTF-8 locales since it got libxo(3) support. It uses strftime(3) that produces non UTF-8 strings passed to xo_emit(3) with wrong %s format - it should be %hs in this case, so xo_emit(3) produces empty output. This change is basically no-op when locale is of UTF-8 type, f.e. en_GB.UTF-8 or ru_RU.UTF-8 or sr_RS.UTF-8@latin. It fixes output for other locales. MFC after: 2 weeks Notes: svn path=/head/; revision=351413
* A single comma was missing to separate the "see also" items inBenedict Reuschling2018-10-201-1/+1
| | | | | | | | | | last.1 and lastlogin.8. Add it back. PR: 231187 Submitted by: david.marec@davenulle.org Notes: svn path=/head/; revision=339450
* Add libxo(3) support to last(1).Philip Paeps2018-08-283-29/+67
| | | | | | | | | | | Reviewed by: kp Approved by: re (gjb) MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16922 Notes: svn path=/head/; revision=338352
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+1
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* Update other man pages to match leap second realityConrad Meyer2018-06-011-2/+2
| | | | | | | | | | | Missed these in r334501; see justification there: https://svnweb.freebsd.org/base?view=revision&revision=334501 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=334502
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Fix a memory leak with lastStephen J. Kiernan2017-06-021-1/+1
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=319508
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-0/+1
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=314436
* Capsicumify last(1)Conrad Meyer2016-12-161-3/+16
| | | | | | | | | Reviewed by: ed (earlier version), emaste (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8001 Notes: svn path=/head/; revision=310139
* Unbreak "last reboot".Ed Schouten2015-07-211-0/+8
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=285742
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+2
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=283595
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync from headSimon J. Gerraty2012-11-042-12/+10
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Fix history, add AUTHORS sectionBaptiste Daroussin2015-06-061-4/+9
| |_|/ |/| | | | | | | | | | | | | | | | | Obtained from: OpenBSD (by schwarze@) Notes: svn path=/head/; revision=284059
* | | mdoc: sort SEE ALSO.Joel Dahl2014-12-261-2/+2
| |/ |/| | | | | Notes: svn path=/head/; revision=276258
* | Bump date missed in r202756Eitan Adler2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | PR: docs/171624 Submitted by: bdrewery Approved by: gabor MFC after: 3 days Notes: svn path=/head/; revision=240506
* | Switch batch to an SLIST.Ed Schouten2012-09-121-11/+9
|/ | | | | | | This code requires none of the features of LIST. Notes: svn path=/head/; revision=240425
* - Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp.Hiroki Sato2012-01-222-5/+6
| | | | | | | | | | | - 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 Notes: svn path=/head/; revision=230458
* Add missing static keywords to last(1)Ed Schouten2011-11-061-20/+20
| | | | Notes: svn path=/head/; revision=227168
* Build last(1) and leave(1) with WARNS=6.Ed Schouten2011-10-141-1/+1
| | | | | | | | These ports were only built with WARNS=1, because they use certain format extensions. We can use NO_WFORMAT for that instead. Notes: svn path=/head/; revision=226361
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-112-8/+0
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=216370
* Remove stale references to utmp(5) and its corresponding filenames.Ed Schouten2010-01-211-6/+6
| | | | | | | I removed utmp and its manpage, but not other manpages referring to it. Notes: svn path=/head/; revision=202756
* Make last(1) display the full log file.Ed Schouten2010-01-191-10/+9
| | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=202643
* Port last(1) to use utmpx.Ed Schouten2010-01-131-101/+82
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=202197
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-0/+2
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386