From owner-freebsd-current Fri Jun 28 13:37:57 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 3E58837B400; Fri, 28 Jun 2002 13:37:49 -0700 (PDT) Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A52B43E06; Fri, 28 Jun 2002 13:37:47 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id g5SKbhHP109138; Fri, 28 Jun 2002 16:37:43 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20020628203526.A8390@alpha.develop.ferrari.net> References: <20020628113454.B34516@espresso.q9media.com> <4381.1025278687@critter.freebsd.dk> <20020628203526.A8390@alpha.develop.ferrari.net> Date: Fri, 28 Jun 2002 16:37:42 -0400 To: Robert Drehmel , Poul-Henning Kamp From: Garance A Drosihn Subject: Re: changing 'struct utmp' Cc: Mike Barcroft , current@FreeBSD.ORG, robert@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) 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 At 8:35 PM +0200 6/28/02, Robert Drehmel wrote: >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. (minor aside: just one 'r' in Garance... :-)) The standard describes a utmpx struct, which is only used by the user-visible routines. The format of the information as it is stored in the actual file is hidden from the applications. Once we get applications calling these routines, then we can change the format of the underlying files whenever we wish. We could even have the first step be to write the "getut*" routines which just reformat information from the present utmp file. >To access members in such a structure functions like > void *utmpx_get_member(struct utmpx *, int which); >could be provided. I think this is some extra work for very little extra gain. Anyone writing a program which is running on multiple platforms will just call the standard routines and reference the fields defined in the utmpx struct. >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. What information is in the actual files, and what format that information is in, does not have to bear any relation to what the user program will see in struct utmpx. >Imagine an administrator wanting to log only remote network >addresses, another one needs resolved complete host names - so >why waste space for both? So you provide all programs with all the information that they expect to find... Programs are written which will do checks based on hostname or based on the IP address. The administrator can not rewrite the programs just because they want to save a few bytes on their hard disk. They might decide to save only 32-bytes of a hostname, or they might be willing to save up to 1024 bytes, but they have to save *something* of the hostname. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message