Date: Fri, 28 Jun 2002 20:35:26 +0200 From: Robert Drehmel <robert@ferrari-electronic.de> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: Mike Barcroft <mike@FreeBSD.ORG>, current@FreeBSD.ORG, robert@FreeBSD.ORG Subject: Re: changing 'struct utmp' Message-ID: <20020628203526.A8390@alpha.develop.ferrari.net> In-Reply-To: <4381.1025278687@critter.freebsd.dk> References: <20020628113454.B34516@espresso.q9media.com> <4381.1025278687@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 28, 2002 at 05:38:07PM +0200, Poul-Henning Kamp wrote: > In message <20020628113454.B34516@espresso.q9media.com>, Mike Barcroft writes: > >Robert Drehmel <robert@zoot.drehmel.com> writes: > >> While trying to fix the bug described in a problem report about > >> 'w -n', and finding out that it is somewhat broken*, I came to > >> the conclusion that our 'struct utmp' is too limiting. > >> > >> I would like to modernize it as follows: > >> > >> #define UT_USERSIZE 16 > >> #define UT_LINESIZE 8 > >> #define UT_HOSTSIZE 18 /* increase by two bytes */ > > > >I think it might be a wise idea to make UT_HOSTSIZE much larger. > >Currently, it isn't even large enough to hold an IPv6 address. > > really guys, we need to do this right. > > The entire "line-number from /etc/ttys is index into file" concept > sucks. > > Fixed sized records suck badly. If people want a more sophisticated solution, I could also create a database format using the 'struct uxtmp' like Garrance and Mike suggested, but with dynamicly sized members, and the possibility to include only specific members in the structure. To access members in such a structure functions like void *utmpx_get_member(struct utmpx *, int which); could be provided. That format would be used for /var/run/utmp, /var/log/wtmp and /var/log/lastlog. It could be made configurable which members to include in 'struct xutmp's stored in the last two. Imagine an administrator wanting to log only remote network addresses, another one needs resolved complete host names - so why waste space for both? Just a thought.. > > Please, if you're going to do it, do it right. > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. ciao, -robert To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020628203526.A8390>
