mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
Fixed a little, long standing bug: smbclient -M <name> should resolve
name#03, not name#20.
Volker
(This used to be commit 99017e887e
)
This commit is contained in:
parent
9f43ccb98e
commit
4af9c9ce3b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user