[Samba] IP in utmp: smbd/session.c

Paul Szabo psz at maths.usyd.edu.au
Mon Nov 25 01:50:01 GMT 2002


Dear Samba developers,

Sometime between versions 2.2.2 and 2.2.7 you made the change:

% diff samba-2.2.2/source/smbd/session.c samba-2.2.7/source/smbd/session.c
92,94c92,97
<       hostname = client_name();
<       if (strequal(hostname,"UNKNOWN"))
<               hostname = client_addr();
---
>         /* 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();

This causes utmp entries to be written with the IP address instead of the
hostname. This is ugly, so I reverted to the pre-2.2.7 version.

I disagree that DNS lookups are an issue. You use hostnames at least for
log file names and for "hosts allow" lookups. The fashion lately is to put
tcp-wrappers around all remote services: does not samba deserve the same?
Sure, avoid repeated lookups (by saving the name upon first lookup); even
implement short timeouts if really needed (but really, just refuse if the
forward/reverse lookups do not "work").


Thanks for this very useful software!

Paul Szabo - psz at maths.usyd.edu.au  http://www.maths.usyd.edu.au:8000/u/psz/
School of Mathematics and Statistics  University of Sydney   2006  Australia



More information about the samba mailing list