utmp stores IP not hostname

ian j hart ianjhart at ntlworld.com
Sat Mar 9 13:10:03 GMT 2002

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.

/* 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();

Fair enough, but, we have dynamic IP addresses.
Quite often I need to check on some "mischief" which
happened many days ago.

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);

...or do I need to write a wrapper for gethostbyaddr?

There was similar one posting to the samba list, but this was
never answered, and I can't find what I need, even with the
web interface.


ian j hart

More information about the samba-technical mailing list