utmp and finger (WAS: Re: some fixes.... Re: connections.tdb & messages.tdb getting full of junk)

Toomas Soome tsoome at ut.ee
Mon Jan 8 23:27:27 GMT 2001


On Tue, 9 Jan 2001, Andrew Bartlett wrote:

> Toomas Soome wrote:
> > 
> > regarding to junk... there is second posting of some of my work. there
> > are some issues fixed - look into diff's attached.
> > 
> > one problem was wrong usage of pointer, while reading session id from
> > tdb:
> > 
> > diff -r1.20.4.3 connection.c
> > 341c341
> > <       slotnum = (int) dbuf.dptr;    ## this is POINTER, you cant juse
> > it like that!
> > ---
> > >       slotnum = *((int*)dbuf.dptr);  ### this is correct way to do
> > 
> > my letter from december follows:
> > 
> 
> --snip quota stuff--
> 
> > utmp related fixes:
> > 1. utmp session fails to be closed in utmp_yield(). problem is actually
> > in utmp_yield_tdb, connection numbed will be saved into utmp.tdb, but
> > utmp_yield_tdb will return pointer to this number, not the number
> > itself.
> > 2. "smb/session_id" in ut_line will confuse finger and other tools (at
> > least in solaris). the fix is to create dummy /dev/smb/session_id files
> > - symlinks to /dev/null. current code assumes existing /dev/smb
> > directory for smb/%d type records, its easy to add call to mkdir() as
> > well. I left it out because I'm not sure about group for this
> > directory.... I guess, need for /dev/smb directory should be documented
> > in smb.conf manpage as well....
> 
> Does ftp (presuming it uses utmp logging) confuse finger in the same
> way?  As this appears to be the standard on these issues 'what do other
> programs do?'. Adding directories to /dev/ seems a bit extreme.

no, ftp does not. I had no time to dig deep into utmpx world to find the
differences.. 

anyway - I can't see ftp sessions in finger, so definitely there are some
differences:
[103] tsoome at kadri:~> ftpcount 
Service class local                -   0 users ( 40 maximum)
Service class remote               -   5 users ( 40 maximum)
[104] tsoome at kadri:~> f

T, 09. jaan  1:28 2001,  püsti 3 tundi, 27 minutit
SunOS 5.8, sun4u sparc tootja Sun_Microsystems, kadri
1 Kasutaja, tööjärjekorra koormus: 0,72, 0,79, 0,96

Kasutaja     Nimi                  Terminal Eemal   Millal     Kust
tsoome       Toomas Soome         *pts/1         09.01  1:27  madli.ut.ee

ftpd is wu-ftpd.

however, I like to see smb sessions in finger...

> 
> Currently the thing that confuses my (linux, RH6.2) finger is the fact
> that users are not logged in the 'last logons' file, and the 'idle for'
> times have always been bogus (not even time logged on).  Adding a
> /dev/smb changes the output from 'w' and 'finger' but the results are
> still just as meaningless.
> 

yes, idle time is bogus - smb/%d is quite hard to bind to some session
specific file.... finger will test file access times to calgulate idle
time.

login & logout times are just ok for me - after pointer dereference fix of
course.

toomas
-- 
The aim of a joke is not to degrade the human being but to remind him that
he is already degraded.
		-- George Orwell





More information about the samba-technical mailing list