diff options
author | Gerald Carter <jerry@samba.org> | 2004-05-11 14:54:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:32 -0500 |
commit | 348b01ff7734c5db7ce37e0fbeeb0de5f675950f (patch) | |
tree | 23b130e3ed04014b30f0bf5989f009272d71d445 /source3/lib/substitute.c | |
parent | 372dac6c982ac52926c268df71bf6fb4ca2d155b (diff) | |
download | samba-348b01ff7734c5db7ce37e0fbeeb0de5f675950f.tar.gz samba-348b01ff7734c5db7ce37e0fbeeb0de5f675950f.tar.bz2 samba-348b01ff7734c5db7ce37e0fbeeb0de5f675950f.zip |
r647: fix for setting the called name to by our IP if the called name was *SMBSERVER and *SMBSERV -- fixes issue with connecting to printers via \ip.ad.dr.ess\printer UNC path
(This used to be commit 8ee268f0ed0c2f75ded9c2ddd66e0953f443c79e)
Diffstat (limited to 'source3/lib/substitute.c')
-rw-r--r-- | source3/lib/substitute.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index fed11c2298..44e791b790 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -40,24 +40,24 @@ void set_local_machine_name(const char* local_name, BOOL perm) static BOOL already_perm = False; fstring tmp_local_machine; + fstrcpy(tmp_local_machine,local_name); + trim_char(tmp_local_machine,' ',' '); + /* * Windows NT/2k uses "*SMBSERVER" and XP uses "*SMBSERV" * arrggg!!! */ - if (strequal(local_name, "*SMBSERVER")) - return; - - if (strequal(local_name, "*SMBSERV")) + if ( strequal(tmp_local_machine, "*SMBSERVER") || strequal(tmp_local_machine, "*SMBSERV") ) { + fstrcpy( local_machine, client_socket_addr() ); return; + } if (already_perm) return; already_perm = perm; - fstrcpy(tmp_local_machine,local_name); - trim_char(tmp_local_machine,' ',' '); alpha_strcpy(local_machine,tmp_local_machine,SAFE_NETBIOS_CHARS,sizeof(local_machine)-1); strlower_m(local_machine); } |