rwhod(8): Prevent clobbering the neighboring field by a wrong cast.
authorSascha Wildner <saw@online.de>
Fri, 30 Mar 2012 16:36:50 +0000 (18:36 +0200)
committerSascha Wildner <saw@online.de>
Fri, 30 Mar 2012 16:39:40 +0000 (18:39 +0200)
commit53aed75490d250452d85022e0961a0a7d1735531
tree353ef62ef0705a843cbc13132dc8b36cbd957889
parent9d4e78c77684f1de021eb8ae17767c210205c3c3
rwhod(8): Prevent clobbering the neighboring field by a wrong cast.

The time stamps in the rwhod(8) network datagram and, based on that,
/var/rwho/whod.* spool files are typed as 32bit int and cannot accept
a 64bit time_t.

The old code clobbered the first bytes of the adjacent "hostname"
field, yielding empty hostnames in local rwho(1) and ruptime(1) output.
(Outgoing datagrams to other hosts were not affected.)

Re-code to let the compiler do the proper coercion (well, until 2038).

Submitted-by: Martin Neitzel
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2339>
usr.sbin/rwhod/rwhod.c