1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s3:libsmb: pass dest_ss to cli_cm_open()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2018-08-23 09:21:41 +02:00 committed by Jeremy Allison
parent e0c502728f
commit 08a7f5c47d
4 changed files with 21 additions and 12 deletions

View File

@ -5719,10 +5719,12 @@ static int process_command_string(const char *cmd_in)
NTSTATUS status;
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
desthost,
service, popt_get_cmdline_auth_info(),
smb_encrypt,
max_protocol, port, name_type,
max_protocol,
have_ip ? &dest_ss : NULL, port,
name_type,
&cli);
if (!NT_STATUS_IS_OK(status)) {
return 1;
@ -6162,9 +6164,10 @@ static int process(const char *base_directory)
NTSTATUS status;
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
desthost,
service, popt_get_cmdline_auth_info(),
smb_encrypt, max_protocol, port,
smb_encrypt, max_protocol,
have_ip ? &dest_ss : NULL, port,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
return 1;
@ -6199,9 +6202,10 @@ static int do_host_query(const char *query_host)
NTSTATUS status;
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : query_host,
query_host,
"IPC$", popt_get_cmdline_auth_info(),
smb_encrypt, max_protocol, port,
smb_encrypt, max_protocol,
have_ip ? &dest_ss : NULL, port,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
return 1;
@ -6245,10 +6249,11 @@ static int do_host_query(const char *query_host)
cli_shutdown(cli);
d_printf("Reconnecting with SMB1 for workgroup listing.\n");
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : query_host,
query_host,
"IPC$", popt_get_cmdline_auth_info(),
smb_encrypt, max_proto,
NBT_SMB_PORT, name_type, &cli);
have_ip ? &dest_ss : NULL, NBT_SMB_PORT,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
d_printf("Unable to connect with SMB1 "
"-- no workgroup available\n");
@ -6278,10 +6283,11 @@ static int do_tar_op(const char *base_directory)
NTSTATUS status;
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
desthost,
service, popt_get_cmdline_auth_info(),
smb_encrypt, max_protocol,
port, name_type, &cli);
have_ip ? &dest_ss : NULL, port,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
ret = 1;
goto out;

View File

@ -112,7 +112,7 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
auth_info,
false,
lp_client_ipc_max_protocol(),
0, 0x20, &cli_ipc);
NULL, 0, 0x20, &cli_ipc);
if (!NT_STATUS_IS_OK(status)) {
cli_ipc = NULL;
}

View File

@ -426,6 +426,7 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
const struct user_auth_info *auth_info,
bool force_encrypt,
int max_protocol,
const struct sockaddr_storage *dest_ss,
int port,
int name_type,
struct cli_state **pcli)
@ -455,7 +456,7 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
auth_info,
force_encrypt,
max_protocol,
NULL, /* dest_ss */
dest_ss,
port,
name_type,
&c);
@ -1004,6 +1005,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
dfs_auth_info,
cli_state_is_encryption_on(rootcli),
smbXcli_conn_protocol(rootcli->conn),
NULL, /* dest_ss not needed, we reuse the transport */
0,
0x20,
&cli_ipc);

View File

@ -150,6 +150,7 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
const struct user_auth_info *auth_info,
bool force_encrypt,
int max_protocol,
const struct sockaddr_storage *dest_ss,
int port,
int name_type,
struct cli_state **pcli);