summaryrefslogtreecommitdiffstats
path: root/source/libsmb
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>1999-01-26 07:29:34 +0000
committerRichard Sharpe <sharpe@samba.org>1999-01-26 07:29:34 +0000
commitb419cc931af7c631423e13c8e524dab4193600db (patch)
tree5f0616e5e77a911f9d98d90db4158ed3ec8ee760 /source/libsmb
parentfdad5f565c41db840e9e2af7e5ea81b42263963b (diff)
downloadsamba-b419cc931af7c631423e13c8e524dab4193600db.tar.gz
samba-b419cc931af7c631423e13c8e524dab4193600db.tar.xz
samba-b419cc931af7c631423e13c8e524dab4193600db.zip
Making the -p functionality in smbclient work again!
Added a function cli_set_port to clientgen.c
Diffstat (limited to 'source/libsmb')
-rw-r--r--source/libsmb/clientgen.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c
index d0ddfa87bef..92a90d2ccf8 100644
--- a/source/libsmb/clientgen.c
+++ b/source/libsmb/clientgen.c
@@ -28,6 +28,17 @@
extern int DEBUGLEVEL;
extern pstring user_socket_options;
+/*
+ * Change the port number used to call on
+ */
+int cli_set_port(struct cli_state *cli, int port)
+{
+ if (port > 0)
+ cli -> port = port;
+
+ return cli -> port;
+}
+
/****************************************************************************
recv an smb
****************************************************************************/
@@ -2377,9 +2388,10 @@ BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip)
cli->dest_ip = *ip;
}
+ if (cli -> port == 0) cli -> port = 139; /* Set to default */
cli->fd = open_socket_out(SOCK_STREAM, &cli->dest_ip,
- 139, cli->timeout);
+ cli -> port, cli->timeout);
if (cli->fd == -1)
return False;
@@ -2405,6 +2417,7 @@ struct cli_state *cli_initialise(struct cli_state *cli)
ZERO_STRUCTP(cli);
+ cli->port = 0;
cli->fd = -1;
cli->cnum = -1;
cli->pid = (uint16)getpid();