Commit Graph

17 Commits

Author SHA1 Message Date
christos
ba99a2b3a4 PR/41313: Chris Spiegel: getutentries() in src/usr.bin/who/utmpentry.c thinks
there are no entries if only one of utmp/utmpx support is selected
mangled && -> ||
2009-05-01 14:26:10 +00:00
christos
f0fa6bf8e1 pass lint. 2008-10-28 14:01:46 +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
christos
f56cde20e9 PR/35135: David A. Holland: timespec patches for utmpentry.c 2006-11-27 16:54:10 +00:00
christos
411ddc6a74 set utmp entry types to user process. 2006-09-20 19:43:33 +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
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
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
christos
f611664450 PR/20317: Johnny Billquist: Clear timestamps upon freeing entries. 2003-02-12 17:39:36 +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