History log of /netbsd-current/usr.sbin/rwhod/rwhod.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.41 30-Oct-2018 kre

sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match.... We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 tls-maxphys-base
# 1.40 04-Nov-2012 christos

branches: 1.40.28;
include <pwd.h>


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.39 31-Aug-2011 joerg

branches: 1.39.2; 1.39.8;
Use __dead


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.38 18-Apr-2009 lukem

Fix -Wsign-compare issue


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.37 21-Jul-2008 lukem

branches: 1.37.6;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.


# 1.36 13-Jul-2008 dholland

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.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.35 15-Dec-2007 perry

branches: 1.35.6;
convert __attribute__s to applicable cdefs.h macros


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-mips64-base wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.34 11-May-2006 mrg

branches: 1.34.10;
assign to wd.wd_recvtime rather than casting a pointer to it
to a time_t pointer to call time(3).


# 1.33 02-Oct-2005 christos

Off by one in copying stuff to struct whoent. Found by Liam Foy.


# 1.32 12-Sep-2005 wiz

Sync usage with man page.


# 1.31 12-Sep-2005 tsarna

Add -u option: rwhod will drop privledges and become the given user.

reviewed by jwise


# 1.30 05-Jul-2005 christos

Patch from Liam J. Foy:
- cleanup sendto code.
- fix usage.


# 1.29 01-Jul-2005 christos

Change g flag to i as in the PR.
Don't allow interval to be set to > 11 minutes.
Rephrase option blurb.


# 1.28 01-Jul-2005 christos

PR/30648: Liam J. Foy: rwhod patch to reduce time interval between broadcasts


# 1.27 27-Jun-2005 junyoung

Remove a unnecessary semicolon and trailing spaces.


# 1.26 24-Jun-2005 peter

- Use the timer* macros from sys/time.h, no need to invent a new time add
function if it already exists.
- Improve a few function/variable names and use EXIT_FAILURE.


# 1.25 24-Jun-2005 christos

Initialize events not revents. Noted by Peter Postma. The timer changes he
can make himself :-)


# 1.24 24-Jun-2005 christos

Fixes from Liam J. Foy to use poll, and proper signals. (from OpenBSD)
While there, ansify, and fix const abuse.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.23 30-Oct-2004 dsl

Add (unsigned char) cast to ctype functions


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.


# 1.21 13-Jul-2003 itojun

use bounded string op


# 1.20 12-Feb-2003 christos

PR/20318: Johnny Billquist: rwhod does not compile with -DDEBUG


Revision tags: fvdl_fs64_base
# 1.19 02-Aug-2002 christos

use utmpx.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.18 11-Oct-2000 is

More format string cleanups by sommerfeld.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.17 30-Dec-1999 itojun

branches: 1.17.4;
avoid memory leak on realloc() error.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.16 15-Nov-1999 mjl

From FreeBSD bin/14844 (slightly modified): Due to signed calculations
with the packet size, a short packet would trigger an infinite loop
on little endian machines.


Revision tags: comdex-fall-1999-base
# 1.15 06-Jun-1999 thorpej

branches: 1.15.4;
Use pidfile(3).


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.14 08-Jul-1998 mrg

branches: 1.14.2;
fix error in previous pointed out by bad. minor KNFing.


# 1.13 06-Jul-1998 mrg

- use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.12 18-Oct-1997 lukem

deprecate register, use warn/err


# 1.11 17-Oct-1997 lukem

WARNSify


# 1.10 25-Aug-1997 kleink

Lseek(2) usage cleanup: the use of L_SET/L_INCR/L_XTND is deprecated,
use SEEK_SET/SEEK_CUR/SEEK_END instead.


# 1.9 07-Sep-1996 explorer

Fix some potential buffer overflow problems.
From David Holland <dholland@hcs.harvard.edu>


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.8 29-May-1994 jtc

sync with 44lite


# 1.7 06-Apr-1994 andrew

rwhod wasn't too happy after the off_t change - its lseek() to check the
boottime was broken. Replaced this code with kvm_nlist()/kvm_read() to be
more efficient.


# 1.6 30-Mar-1994 cgd

kill bad casts


# 1.5 28-Mar-1994 cgd

kill extern'd lseek()


# 1.4 15-Dec-1993 mycroft

From: mrm@sceard.com (M.R.Murphy)
Fix memory leak.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 18-Apr-1993 mycroft

Cleanup for GCC 2.


Revision tags: netbsd-0-8 netbsd-alpha-1 patchkit-0-2-2
# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
after 0.2.2 "stable" patches applied