More utmp stuff

Freddie freddie at ns1.nowait.net
Sat Mar 25 01:32:29 GMT 2000


At 08:28 25/03/2000, you wrote:
>David Lee wrote:
> >
> >
> > Why, conceptually, do you think it needs changing?  Your example has three
> > connections, giving three utmp entries.  What, conceptually is wrong with
> > that?
> >
> > By analogy, if there are three connections between an X-terminal and a
> > timesharing machine, that, rightly, gives three utmp entries.  You seem to
> > be arguing that Samba should use a fundamentally different model.  Could
> > you persuade us why?
>
>  Actually xterm has a flag to stop it from writing into utmp, and most
>systems i've used are setup that way. utmp has ONE entry per 'session'
>not one per xterm.
>
>  If all  you want to know is who is using the machine, having the same
>user listed 5 times 'cause they are connected to 5 different SMB
>resources is a bit much. If you want to know what they are connected to
>use smbstatus...
>
>  Can we at least have an option for ONE entry and some sort of reference
>count on that users connections so it goes away after the last resource
>is disconnected ?.
>  For many years I have  been running a pre/post exec on the 'homes'
>share to get entries utmp, of course if for some reason they disconnect
>from 'homes' and not the others....
>
>  You can argue both ways on this one I expect.

I've already spent 2 days working on having consolidated utmp entries from 
the same IP address, and it works fine on Linux. The way I've done it 
probably _won't_ work on FreeBSD though, as it has no ut_id field.

I've been talking with David Lee about bits and pieces, and we both thought 
it would be good to have a "utmp consolidate" parameter for this. As soon 
as we get an official base to work on, I guess we'll get to do some work :)

I have glibc 2.0.x (Debian 2.1) and 2.1.x (Debian 2.2) machines at home, so 
I should be able to get utmp consolidation working on both of those 
architectures. The only access I have to FreeBSD machines is as a normal 
user, but I can at least read man pages. The utmp struct in FreeBSD (no 
idea if it's different in the other BSD flavours) is majorly different from 
Linux's:

            struct utmp {
                    char    ut_line[UT_LINESIZE];
                    char    ut_name[UT_NAMESIZE];
                    char    ut_host[UT_HOSTSIZE];
                    long    ut_time;
            };

No ut_id, no ut_addr_v6, and ut_time is a long, not a timeval struct. 
UT_LINESIZE, UT_NAMESIZE and UT_HOSTSIZE seem to be defined on both FreeBSD 
and Linux, which is a good thing.

Linux (glibc 2.0.x):
               #define UT_LINESIZE           12
               #define UT_NAMESIZE           32
               #define UT_HOSTSIZE           256

FreeBSD (3.2-RELEASE):
            #define UT_NAMESIZE     16
            #define UT_LINESIZE     8
            #define UT_HOSTSIZE     16

Just a little different. I have no idea how to go about making configure 
check out the utmp struct to find out which features it does/doesn't have. 
And unless we add another field to each connection struct, I don't see any 
way (apart from finding duplicate connections based on the NetBIOS name of 
the client, is that acceptable?) of tracking utmp entries.

Freddie




More information about the samba-technical mailing list