summaryrefslogtreecommitdiff
path: root/source4/client/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/client/client.c')
-rw-r--r--source4/client/client.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 43135e13ea..2f6a7abcc0 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -2997,16 +2997,19 @@ static int process_stdin(struct smbclient_context *ctx)
char *the_prompt = talloc_asprintf(ctx, "smb: %s> ", ctx->remote_cur_dir);
char *cline = smb_readline(the_prompt, readline_callback, completion_fn);
talloc_free(the_prompt);
-
+
if (!cline) break;
-
+
/* special case - first char is ! */
if (*cline == '!') {
system(cline + 1);
+ free(cline);
continue;
}
- rc |= process_command_string(ctx, cline);
+ rc |= process_command_string(ctx, cline);
+ free(cline);
+
}
return rc;
@@ -3017,7 +3020,7 @@ static int process_stdin(struct smbclient_context *ctx)
return a connection to a server
*******************************************************/
static bool do_connect(struct smbclient_context *ctx,
- const char *specified_server, const char *specified_share, struct cli_credentials *cred)
+ const char *specified_server, const char **ports, const char *specified_share, struct cli_credentials *cred)
{
NTSTATUS status;
char *server, *share;
@@ -3034,7 +3037,7 @@ static bool do_connect(struct smbclient_context *ctx,
ctx->remote_cur_dir = talloc_strdup(ctx, "\\");
- status = smbcli_full_connection(ctx, &ctx->cli, server,
+ status = smbcli_full_connection(ctx, &ctx->cli, server, ports,
share, NULL, cred,
cli_credentials_get_event_context(cred));
if (!NT_STATUS_IS_OK(status)) {
@@ -3061,7 +3064,7 @@ static int do_host_query(struct loadparm_context *lp_ctx, const char *query_host
/****************************************************************************
handle a message operation
****************************************************************************/
-static int do_message_op(const char *netbios_name, const char *desthost, const char *destip, int name_type, const char **name_resolve_order, int max_xmit, int max_mux)
+static int do_message_op(const char *netbios_name, const char *desthost, const char **destports, const char *destip, int name_type, struct resolve_context *resolve_ctx, int max_xmit, int max_mux)
{
struct nbt_name called, calling;
const char *server_name;
@@ -3073,7 +3076,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c
server_name = destip ? destip : desthost;
- if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, name_resolve_order, max_xmit, max_mux)) {
+ if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, resolve_ctx, max_xmit, max_mux)) {
d_printf("Connection to %s failed\n", server_name);
return 1;
}
@@ -3221,10 +3224,10 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c
}
if (message) {
- return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, dest_ip, name_type, lp_name_resolve_order(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx));
+ return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, lp_resolve_context(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx));
}
- if (!do_connect(ctx, desthost, service, cmdline_credentials))
+ if (!do_connect(ctx, desthost, lp_smb_ports(cmdline_lp_ctx), service, cmdline_credentials))
return 1;
if (base_directory)