diff options
author | Jeremy Allison <jra@samba.org> | 2002-05-08 23:15:42 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-05-08 23:15:42 +0000 |
commit | 6337369a903b07ef42c050f77d439d8b11b7f6bf (patch) | |
tree | abda56fceb9808341b1f26c06460b31b28011d96 /source3/param/loadparm.c | |
parent | 7a959e81d42bdff1269589b7d17a12ab0b3243be (diff) | |
download | samba-6337369a903b07ef42c050f77d439d8b11b7f6bf.tar.gz samba-6337369a903b07ef42c050f77d439d8b11b7f6bf.tar.bz2 samba-6337369a903b07ef42c050f77d439d8b11b7f6bf.zip |
Merge in Jerry's called name fix.
Jeremy.
(This used to be commit 6d957924579d64407bdd94d7e78088fb1ea5c9ce)
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r-- | source3/param/loadparm.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0d8df080bd..4145be8e6f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4199,5 +4199,25 @@ void lp_set_logfile(const char *name) const char *get_called_name(void) { extern fstring local_machine; - return (*local_machine) ? local_machine : global_myname; + 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; + } + } + + return local_machine; } |