From 1c92b99c80632bfdaeba60be2ba885ad84285460 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 23 Mar 2002 09:00:27 +0000 Subject: Correctly store the hostname of the remote machine if so configured. If the reverse DNS fails, then store the IP. (This used to be commit d97771aa80b48fbdb9cae3e9712e35fcc895b148) --- source3/smbd/session.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source3/smbd/session.c b/source3/smbd/session.c index 6f9d62edfd..05a7b24da2 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -78,11 +78,13 @@ BOOL session_claim(user_struct *vuser) } /* If 'hostname lookup' == yes, then do the DNS lookup. This is - needed becouse utmp and PAM both expect DNS names */ + needed becouse utmp and PAM both expect DNS names + + client_name() handles this case internally. + */ - if (lp_hostname_lookups()) { - hostname = client_name(); - } else { + hostname = client_name(); + if (strcmp(hostname, "UNKNOWN") == 0) { hostname = client_addr(); } -- cgit