summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-02-09 03:29:36 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-02-09 03:29:36 +0000
commitdfecd6a4534743a3e140eafc9836911286793951 (patch)
treead4ce96f4d1c3f4ddcaec6aa52147f250d03a11b /source
parente734c1971d2841b2cfe37414fe4893f4a66b22a9 (diff)
downloadsamba-dfecd6a4534743a3e140eafc9836911286793951.tar.gz
samba-dfecd6a4534743a3e140eafc9836911286793951.tar.xz
samba-dfecd6a4534743a3e140eafc9836911286793951.zip
Do the reverse DNS lookup, but only if 'hostname lookups = yes'
Andrew Bartlett
Diffstat (limited to 'source')
-rw-r--r--source/smbd/session.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/smbd/session.c b/source/smbd/session.c
index c8f77aaa61a..6f9d62edfdb 100644
--- a/source/smbd/session.c
+++ b/source/smbd/session.c
@@ -77,12 +77,14 @@ BOOL session_claim(user_struct *vuser)
return False;
}
- /* 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. */
+ /* If 'hostname lookup' == yes, then do the DNS lookup. This is
+ needed becouse utmp and PAM both expect DNS names */
- hostname = client_addr();
+ if (lp_hostname_lookups()) {
+ hostname = client_name();
+ } else {
+ hostname = client_addr();
+ }
fstrcpy(sessionid.username, vuser->user.unix_name);
fstrcpy(sessionid.hostname, hostname);