Commit Graph

52 Commits

Author SHA1 Message Date
christos ecfa5800d4 PR/39201: Brian Marcotte: "who am i" problem when using ptyfs, because it
strips pts/
2008-07-24 15:35:41 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
dholland 16e3bec279 Clarify how one is supposed to use the pointers returned by getutentries()
(the utmpentry.c code), specifically with respect to who owns them and
when to free them. Now they're owned by utmpentry.c, only. Abolish the
freeutentries() function, which was the wrong abstraction; add instead
endutentries(), which flushes out the internally managed memory.

Update callers as necessary. Some (e.g. talkd) had been leaking memory;
others (e.g. syslogd) had been accidentally freeing and reloading utmp
more often than necessary. There are a couple untidy bits in users and
rwhod that someone should look after sometime, maybe.

Fixes PR bin/35131, which was about talkd's memory leak.
2008-07-13 20:07:48 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dholland d06b9ed56d Amplify comments from the previous commit. If xtos misread what was
going on, they can't have been clear enough. (And if xtos misread it,
so will anyone else passing by, and then someone will "fix" it...)

Hopefully this will help. Maybe it should be changed to use memcpy
instead of strncpy after all.
2008-03-08 22:41:03 +00:00
dholland 9cf185a523 Remove reflexive cargo-cult-style null-termination after strncpy; it is
neither needed nor particularly desirable. Add comments to explain what's
going on, and arrange to fail the build if the sizes of things get out
of whack.
Resolves PR bin/38201 from Chris Spiegel.
2008-03-08 22:29:26 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
wiz 2f0d7fe863 Use Pq. 2007-01-18 00:15:05 +00:00
christos c3761c950c Sync with reality. Delete unsupported and describe run level chars. 2007-01-17 16:37:41 +00:00
christos f56cde20e9 PR/35135: David A. Holland: timespec patches for utmpentry.c 2006-11-27 16:54:10 +00:00
christos a86c4b2a6a better format for run level entries. 2006-09-28 15:24:31 +00:00
wiz 7158992a0e Mark up flags in -a description. Start sentences with upper-case letters. 2006-09-23 10:06:57 +00:00
christos c044a535e1 add definition for down time. 2006-09-22 21:40:12 +00:00
christos 411ddc6a74 set utmp entry types to user process. 2006-09-20 19:43:33 +00:00
christos 14e0a0ccc6 unbreak the build by including the appropriate header files here. 2006-09-20 19:39:23 +00:00
christos cbf3acdacb Add support for the majority of the rest of the system V options, although
we don't support some of them. We might add boottime, system clock change
time, in the future, so add the code to do it.
2006-09-19 21:01:29 +00:00
wiz d16e662529 Document /var/log/wtmpx.[0-9] too. 2006-09-19 19:04:52 +00:00
hubertf d7f002b78d Change -u behaviour to also print PID of process on terminal, and
add -d to print more information from utmpx.

OK'd by christos@
2006-09-19 14:35:25 +00:00
elad cbe6a15c01 Another overrun forgotten in previous commit, also found by Coverity.
CID 1481.
2006-03-17 20:44:28 +00:00
elad ab24a02ffe Fix buffer overrun found by Coverity, CID 1482. 2006-03-17 20:41:02 +00:00
peter 0d03348661 Implement the following two XSI extensions:
-q: quick mode, list only the names and the number of users currently
logged on.

-s: default mode, list only the name, line and time fields.
2005-07-22 14:23:05 +00:00
christos b2d91da0d4 WARNS=3 2005-06-26 17:10:28 +00:00
peter 1a4cb94e52 Sort options.
ok wiz@
2004-11-22 17:20:02 +00:00
christos 29950aef4a Check the result of stat and warn if things are not found.
Change all err/x to warn/x
2004-10-22 15:50:47 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
wiz df5a50364e Use $NetBSD$ instead of $Header$. 2003-11-28 23:52:34 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
wiz d1084fd16c Quote question mark. 2003-06-27 09:42:24 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
christos 46a5ddc0d3 fix static length variables. 2003-02-17 13:56:28 +00:00
christos f611664450 PR/20317: Johnny Billquist: Clear timestamps upon freeing entries. 2003-02-12 17:39:36 +00:00
grant be8ae688ae New sentence, new line. 2002-09-30 11:08:56 +00:00
christos 7e66d492ee make this compile with either utmp or utmpx there. 2002-08-01 23:51:42 +00:00
christos 75db63d9a2 - don't hide a global. 2002-08-01 23:36:30 +00:00
christos eb122f434a abstract out utmp loading. 2002-08-01 23:23:07 +00:00
christos c5c71978de add utmpx support; lots of code can be shared now with w. 2002-07-28 21:46:34 +00:00
wiz aded0d2cce Whitespace cleanup. 2001-12-01 16:43:07 +00:00
christos 6653fa8b3c How did this bug survive for so long? 'who am i' was busted because
it checked for valid utmp entries with usr.ut_name != NULL which can
never happen ofcourse, instead of usr.ut_name[0] != '\0'
1999-07-17 16:41:44 +00:00
christos 911f0fccb0 cast field sizes to ints. 1998-12-20 14:53:24 +00:00
lukem 87a83d449c fix .Nm usage, deprecate register, use ANSI string.h stuff 1997-10-20 03:20:27 +00:00
jtc 5b466bef97 Changed order of STANDARDS and HISTORY subheads to conform with
specification in mdoc(7).
1997-09-09 07:26:02 +00:00
kleink cce3084228 Add WARNS=1. 1997-07-23 20:09:25 +00:00
kleink db21fa89df Document `-H' flag. 1997-07-23 20:08:53 +00:00
kleink df138b3d94 * __RCSID()/__COPYRIGHT() police.
* Prototypes; fix compiler warnings.
* setlocale(LC_ALL, "") on startup.
* Add XPG4.2 `-H' flag.
1997-07-23 20:08:03 +00:00
mouse ee6a5b2cd6 alternate -> alternative, per PR 2643 1997-03-08 14:24:19 +00:00
jtc c7c97b414c Added code for POSIX.2's -m, -T, and -u options. 1994-12-07 04:28:47 +00:00
jtc 5ff6f16bd7 Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
1994-11-14 05:13:14 +00:00
deraadt 9e884098d2 fix from <dgy@mcs.com> 1994-04-08 08:09:14 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft c3e42d1c64 Add RCS indentifiers. 1993-08-01 07:22:47 +00:00