summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-04-11 03:34:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:35 -0500
commit121c22d1d5f2f673cedbbfe658a97e816938eef1 (patch)
treee48e286e8b9887229fad77d2afa06ba24573f5a0 /source3
parent380979282f2354b56da4a2f2ac39d44a8cedbe0e (diff)
downloadsamba-121c22d1d5f2f673cedbbfe658a97e816938eef1.tar.gz
samba-121c22d1d5f2f673cedbbfe658a97e816938eef1.tar.bz2
samba-121c22d1d5f2f673cedbbfe658a97e816938eef1.zip
r6291: BUG 2588: force smbclient messages to port 139 unless someone set the -p option
(This used to be commit 40f573e202096088957bfff8ca2eb49f5b4985bd)
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 204e51d4cc..604bf0989a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -3252,6 +3252,7 @@ static int do_message_op(void)
struct nmb_name called, calling;
fstring server_name;
char name_type_hex[10];
+ int msg_port;
make_nmb_name(&calling, calling_name, 0x0);
make_nmb_name(&called , desthost, name_type);
@@ -3264,7 +3265,11 @@ static int do_message_op(void)
if (have_ip)
ip = dest_ip;
- if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, port) != port) ||
+ /* we can only do messages over port 139 (to windows clients at least) */
+
+ msg_port = port ? port : 139;
+
+ if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, msg_port) != msg_port) ||
!cli_connect(cli, server_name, &ip)) {
d_printf("Connection to %s failed\n", desthost);
return 1;