From: Andreas Schneider Date: Thu, 27 Aug 2020 13:24:27 +0000 (+0200) Subject: s3:libsmb: Remove force_encrypt from cli_cm_open() X-Git-Tag: talloc-2.3.2~284 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9fbc8dae878ddfa54153e91cc1128c307816b76;p=thirdparty%2Fsamba.git s3:libsmb: Remove force_encrypt from cli_cm_open() Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source3/client/client.c b/source3/client/client.c index a68a4663491..d5d5e157b29 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -5545,9 +5545,6 @@ static int process_command_string(const char *cmd_in) TALLOC_CTX *ctx = talloc_tos(); char *cmd = talloc_strdup(ctx, cmd_in); int rc = 0; - bool smb_encrypt = - get_cmdline_auth_info_smb_encrypt( - popt_get_cmdline_auth_info()); if (!cmd) { return 1; @@ -5560,7 +5557,6 @@ static int process_command_string(const char *cmd_in) status = cli_cm_open(talloc_tos(), NULL, desthost, service, popt_get_cmdline_auth_info(), - smb_encrypt, max_protocol, have_ip ? &dest_ss : NULL, port, name_type, @@ -6001,14 +5997,11 @@ static int process(const char *base_directory) { int rc = 0; NTSTATUS status; - bool smb_encrypt = - get_cmdline_auth_info_smb_encrypt( - popt_get_cmdline_auth_info()); status = cli_cm_open(talloc_tos(), NULL, desthost, service, popt_get_cmdline_auth_info(), - smb_encrypt, max_protocol, + max_protocol, have_ip ? &dest_ss : NULL, port, name_type, &cli); if (!NT_STATUS_IS_OK(status)) { @@ -6042,14 +6035,11 @@ static int process(const char *base_directory) static int do_host_query(const char *query_host) { NTSTATUS status; - bool smb_encrypt = - get_cmdline_auth_info_smb_encrypt( - popt_get_cmdline_auth_info()); status = cli_cm_open(talloc_tos(), NULL, query_host, "IPC$", popt_get_cmdline_auth_info(), - smb_encrypt, max_protocol, + max_protocol, have_ip ? &dest_ss : NULL, port, name_type, &cli); if (!NT_STATUS_IS_OK(status)) { @@ -6096,7 +6086,7 @@ static int do_host_query(const char *query_host) status = cli_cm_open(talloc_tos(), NULL, query_host, "IPC$", popt_get_cmdline_auth_info(), - smb_encrypt, max_proto, + max_proto, have_ip ? &dest_ss : NULL, NBT_SMB_PORT, name_type, &cli); if (!NT_STATUS_IS_OK(status)) { @@ -6122,9 +6112,6 @@ static int do_tar_op(const char *base_directory) { struct tar *tar_ctx = tar_get_ctx(); int ret = 0; - bool smb_encrypt = - get_cmdline_auth_info_smb_encrypt( - popt_get_cmdline_auth_info()); /* do we already have a connection? */ if (!cli) { @@ -6133,7 +6120,7 @@ static int do_tar_op(const char *base_directory) status = cli_cm_open(talloc_tos(), NULL, desthost, service, popt_get_cmdline_auth_info(), - smb_encrypt, max_protocol, + max_protocol, have_ip ? &dest_ss : NULL, port, name_type, &cli); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c index 1b8f2a4e97a..0fd31ef3d5a 100644 --- a/source3/lib/netapi/cm.c +++ b/source3/lib/netapi/cm.c @@ -110,7 +110,6 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx, status = cli_cm_open(ctx, NULL, server_name, "IPC$", auth_info, - false, lp_client_ipc_max_protocol(), NULL, 0, 0x20, &cli_ipc); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index aff998f6187..4825b8f3fae 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -383,7 +383,6 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx, const char *server, const char *share, const struct user_auth_info *auth_info, - bool force_encrypt, int max_protocol, const struct sockaddr_storage *dest_ss, int port, @@ -393,6 +392,8 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx, /* Try to reuse an existing connection in this list. */ struct cli_state *c = cli_cm_find(referring_cli, server, share); NTSTATUS status; + bool force_encrypt = + get_cmdline_auth_info_smb_encrypt(auth_info); if (c) { *pcli = c; @@ -962,7 +963,6 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx, smbXcli_conn_remote_name(rootcli->conn), "IPC$", dfs_auth_info, - cli_state_is_encryption_on(rootcli), smbXcli_conn_protocol(rootcli->conn), NULL, /* dest_ss not needed, we reuse the transport */ 0, diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index cb42df88426..360a39b9a54 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -128,7 +128,6 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx, const char *server, const char *share, const struct user_auth_info *auth_info, - bool force_encrypt, int max_protocol, const struct sockaddr_storage *dest_ss, int port,