diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-10-04 10:46:52 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-10-04 10:46:52 +0000 |
commit | 7c3c022a8913aec76a175095475cfcf8a4dfd698 (patch) | |
tree | 63ce05fdddd8b160f717aac7337daa961d56a5f6 /source3/smbwrapper | |
parent | a1b002fcbe5daa91ce8bc94b73760e2428238315 (diff) | |
download | samba-7c3c022a8913aec76a175095475cfcf8a4dfd698.tar.gz samba-7c3c022a8913aec76a175095475cfcf8a4dfd698.tar.bz2 samba-7c3c022a8913aec76a175095475cfcf8a4dfd698.zip |
use *SMBSERVER convention in smbwrapper to allow us to connect to
servers that we don't know the netbios name of.
(This used to be commit 147d49dade3901835b5d60b02c495bea544ff5e9)
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r-- | source3/smbwrapper/smbw.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c index 0abe823e29..054b694c41 100644 --- a/source3/smbwrapper/smbw.c +++ b/source3/smbwrapper/smbw.c @@ -360,21 +360,27 @@ struct smbw_server *smbw_server(char *server, char *share) return NULL; } + make_nmb_name(&calling, global_myname, 0x0, ""); + make_nmb_name(&called , server, 0x20, ""); + + again: /* have to open a new connection */ if (!cli_initialise(&c) || !cli_connect(&c, server, NULL)) { errno = ENOENT; return NULL; } - make_nmb_name(&calling, global_myname, 0x0, ""); - make_nmb_name(&called , server, 0x20, ""); - if (!cli_session_request(&c, &calling, &called)) { cli_shutdown(&c); + if (strcmp(called.name, "*SMBSERVER")) { + make_nmb_name(&called , "*SMBSERVER", 0x20, ""); + goto again; + } errno = ENOENT; return NULL; } + if (!cli_negprot(&c)) { cli_shutdown(&c); errno = ENOENT; |