diff options
author | Volker Lendecke <vlendec@samba.org> | 2002-09-05 11:40:06 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2002-09-05 11:40:06 +0000 |
commit | 4af9c9ce3b312131ba767ba27b5cd5b12d6a6007 (patch) | |
tree | b1e7e6a03ecee559a275b9fb2613af11a0297b5b /source3 | |
parent | 9f43ccb98e32b343b021f9ea6a8eeef7e1fe5c89 (diff) | |
download | samba-4af9c9ce3b312131ba767ba27b5cd5b12d6a6007.tar.gz samba-4af9c9ce3b312131ba767ba27b5cd5b12d6a6007.tar.xz samba-4af9c9ce3b312131ba767ba27b5cd5b12d6a6007.zip |
Fixed a little, long standing bug: smbclient -M <name> should resolve
name#03, not name#20.
Volker
(This used to be commit 99017e887e4189ac7f6e3b7df08f028dc155191e)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/client.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index d5a1f557e7..7afd8f25bc 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -2618,16 +2618,21 @@ static int do_message_op(void) { struct in_addr ip; struct nmb_name called, calling; - - zero_ip(&ip); + fstring server_name; + char name_type_hex[10]; make_nmb_name(&calling, global_myname, 0x0); make_nmb_name(&called , desthost, name_type); + safe_strcpy(server_name, desthost, sizeof(server_name)); + snprintf(name_type_hex, sizeof(name_type_hex), "#%X", name_type); + safe_strcat(server_name, name_type_hex, sizeof(server_name)); + zero_ip(&ip); if (have_ip) ip = dest_ip; - if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, port) != port) || !cli_connect(cli, desthost, &ip)) { + if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, port) != port) || + !cli_connect(cli, server_name, &ip)) { d_printf("Connection to %s failed\n", desthost); return 1; } |