Try to keep existing behaviour for our printing code - never return
authorAndrew Bartlett <abartlet@samba.org>
Wed, 23 Apr 2003 01:44:04 +0000 (01:44 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 23 Apr 2003 01:44:04 +0000 (01:44 +0000)
global_myname(), always either the name the client called us, or if they
didn't call us anything useful, our IP address.

Jerry, can you check this?

Andrew Bartlett
(This used to be commit 599e70bffbae9930b949c9b82cbc8dfc7c966d78)

source3/param/loadparm.c

index a89330fd5beccc54540be7c9ac3c9c14953ffd31..4bc8d7bfc25721cee155b65f977a1556f6f7a4e9 100644 (file)
@@ -3994,7 +3994,7 @@ void lp_set_logfile(const char *name)
 }
 
 /*******************************************************************
- Return the NetBIOS called name.
+ Return the NetBIOS called name, or my IP - but never global_myname().
 ********************************************************************/
 
 const char *get_called_name(void)
@@ -4002,22 +4002,11 @@ const char *get_called_name(void)
        extern fstring local_machine;
        static fstring called_name;
 
-       if (! *local_machine)
-               return global_myname();
-
-       /*
-        * Windows NT/2k uses "*SMBSERVER" and XP uses "*SMBSERV"
-        * arrggg!!! but we've already rewritten the client's
-        * netbios name at this point...
-        */
-
-       if (*local_machine) {
-               if (!StrCaseCmp(local_machine, "_SMBSERVER") || !StrCaseCmp(local_machine, "_SMBSERV")) {
-                       fstrcpy(called_name, get_my_primary_ip());
-                       DEBUG(8,("get_called_name: assuming that client used IP address [%s] as called name.\n",
-                               called_name));
-                       return called_name;
-               }
+       if (!*local_machine) {
+               fstrcpy(called_name, get_my_primary_ip());
+               DEBUG(8,("get_called_name: assuming that client used IP address [%s] as called name.\n",
+                        called_name));
+               return called_name;
        }
 
        return local_machine;