utmp stores IP not hostname

ian j hart ianjhart at ntlworld.com
Sat Mar 9 16:27:02 GMT 2002


Andrew Bartlett wrote:
> 
> ian j hart wrote:
> >
> > I would like to start using wtmp for recording
> > logons. This is with 2.2.3a under FreeBSD 4.5.
> >
> > It appears that session.c doesn't do a name lookup
> > and so the IP address is stored in the wtmp file.
> >
> > <quote>
> > /* Don't resolve the hostname in smbd as we can pause for a long
> > time while waiting for DNS timeouts to occur.  The correct
> > place to do this is in the code that displays the session
> > information. */
> >
> > hostname = client_addr();
> > </quote>
> >
> > Fair enough, but, we have dynamic IP addresses.
> > Quite often I need to check on some "mischief" which
> > happened many days ago.
> 
> This is why I 'fixed' this in HEAD, I wasn't aware it had been broken in
> 2.2 as well.  I've just looked at HEAD again, and I'll be making a
> couple more changes.
> 
> > e.g. spoofing email sender.
> > Since the hostname is in the mail header I can use
> > "last" to find who was logged into the box at that
> > time. I need to be able to do this even if the IP
> > address has changed.
> >
> > Two questions:-
> > Does the tdb support storing IPs AND hostnames (Or
> > will this corrupt it)?.
> >
> > Is there a drop in function for the line of code above.
> > A function like...
> >
> > char * client_hostname(void);
> 
> That should be fine, the function is 'client_name()'.  In HEAD I made
> this conditional on 'hostname lookups = yes'.  This paramater needs to
> be moved into 2.2.
> 
> Andrew Bartlett

Cheers. I'll look at this later as it's quite
late/early here.

-- 
ian j hart




More information about the samba-technical mailing list