Correctly store the hostname of the remote machine if so configured. If the
authorAndrew Bartlett <abartlet@samba.org>
Sat, 23 Mar 2002 09:00:27 +0000 (09:00 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 23 Mar 2002 09:00:27 +0000 (09:00 +0000)
reverse DNS fails, then store the IP.

source/smbd/session.c

index 6f9d62edfdb920c2711ea6cc2294a43befa72864..05a7b24da284262338f852bd0e384594a5b0d4bf 100644 (file)
@@ -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();
        }