Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jun 2002 16:37:42 -0400
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Robert Drehmel <robert@ferrari-electronic.de>, 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:  <p051117b3b9426dd5abc4@[128.113.24.47]>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p051117b3b9426dd5abc4>