From owner-freebsd-current Fri Jun 28 11:46:47 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5721437B411; Fri, 28 Jun 2002 11:45:31 -0700 (PDT) Received: from alpha.develop.ferrari.net (host1.ferrari-electronic.de [62.159.79.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0092343E1C; Fri, 28 Jun 2002 11:43:56 -0700 (PDT) (envelope-from robert@ferrari-electronic.de) Received: (from robert@localhost) by alpha.develop.ferrari.net (8.11.6/8.11.6/SuSE Linux 0.5) id g5SIZQx08433; Fri, 28 Jun 2002 20:35:26 +0200 Date: Fri, 28 Jun 2002 20:35:26 +0200 From: Robert Drehmel To: Poul-Henning Kamp Cc: Mike Barcroft , current@FreeBSD.ORG, robert@FreeBSD.ORG Subject: Re: changing 'struct utmp' Message-ID: <20020628203526.A8390@alpha.develop.ferrari.net> References: <20020628113454.B34516@espresso.q9media.com> <4381.1025278687@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4381.1025278687@critter.freebsd.dk> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 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