From f13763ca4be49c08dfc533e39dd338b508ba4709 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 12 Apr 2009 12:52:42 +0200 Subject: [PATCH] Fix a bug in smbclient not sending the correct called name Jeremy, I think the ability to say smbclient //foo/bar -I -p 139 making the called name to "foo" got lost with 3d2d0203. Was this removed deliberately? If so, please revert this patch. If not, please merge appropriately. Thanks, Volker --- source3/libsmb/clidfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 430807eb7f3..98b96cfc566 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -94,6 +94,7 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, { struct cli_state *c = NULL; struct nmb_name called, calling; + const char *called_str; const char *server_n; struct sockaddr_storage ss; char *servicename; @@ -111,6 +112,7 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, sharename = servicename; if (*sharename == '\\') { sharename += 2; + called_str = sharename; if (server == NULL) { server = sharename; } @@ -120,6 +122,8 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, } *sharename = 0; sharename++; + } else { + called_str = server; } server_n = server; @@ -127,7 +131,7 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, zero_sockaddr(&ss); make_nmb_name(&calling, global_myname(), 0x0); - make_nmb_name(&called , server, name_type); + make_nmb_name(&called , called_str, name_type); again: zero_sockaddr(&ss); -- 2.11.4.GIT