More utmp stuff

David Lee T.D.Lee at
Mon Mar 27 15:40:01 GMT 2000

On Fri, 24 Mar 2000, Steve Langasek wrote:

> On Sat, 25 Mar 2000, David Lee wrote:
> > o  The sheer variety of utmp implementations means that porting is
> >    becoming increasingly non-trivial.
> > o  We should strongly consider moving the code out of "smbd/connection.c"
> >    into a separate file, because the code will, of necessity, become
> >    increasingly littered with "#ifdef MY-LITTLE-OS" constructions
> >    (somewhat akin to "smbd/quotas.c").
> Regardless of whether you break the utmp code out into a separate file, it
> seems to me that this is a good place to apply the autoconf principle of "test
> for features, not for platforms".  Although each utmp implementation has its
> quirks, I imagine there are relatively few points on which they actually
> differ.

Good point.  My example "MY-LITTLE-OS" was, indeed, poor and should be
more like "THIS-LITTLE-QUIRK". 

> Also, determining the location of the utmp file can probably be done cleaner
> in a header file or in autoconf.  glibc defines the path in <utmp.h>
> (<utmpx.h>) to be _PATH_UTMP (_PATH_UTMPX).  Other OSes surly define something
> similar--or is the problem that there are OSes whose header definitions don't
> match the real path?

o  I had originally sketched it with "connection.c" for self-containment
   and ease of debugging, but agree that autoconf/ is
   probably the most appropriate place in general.

o  My traditional understanding was that caution should be exercised in
   using #defines with a leading "_", and that the publicly-used variables
   did not have a leading "_".

o  What do various systems have?  Example: Solaris 2 has names like
   "UTMPX_FILE" (various flavours of {U,W}, {,X} and leading "_"), but no

o  I don't yet know of definitions not matching paths.  But at least one
   OS (AIX) apparently gives the impression of supporting the x-files when
   it doesn't... 

Best wishes.


:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:            South Road            :
:                                           Durham                :
:  Phone: +44 191 374 2882                  U.K.                  :

More information about the samba-technical mailing list