diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-02-09 03:29:36 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-02-09 03:29:36 +0000 |
commit | c1d83be9b5e8f928e2234528d5f99a771d23ca37 (patch) | |
tree | 550b6f337c24d2c31e9d3efae426bea4056edbdc /source3 | |
parent | 7dbaaa09643db9e4f7eb129a9d38816e17e3b80c (diff) | |
download | samba-c1d83be9b5e8f928e2234528d5f99a771d23ca37.tar.gz samba-c1d83be9b5e8f928e2234528d5f99a771d23ca37.tar.bz2 samba-c1d83be9b5e8f928e2234528d5f99a771d23ca37.zip |
Do the reverse DNS lookup, but only if 'hostname lookups = yes'
Andrew Bartlett
(This used to be commit dfecd6a4534743a3e140eafc9836911286793951)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/session.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/smbd/session.c b/source3/smbd/session.c index c8f77aaa61..6f9d62edfd 100644 --- a/source3/smbd/session.c +++ b/source3/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); |