if (smbXcli_conn_dfs_supported(c->conn) &&
cli_check_msdfs_proxy(ctx, c, sharename,
&newserver, &newshare,
- force_encrypt, creds)) {
+ creds)) {
cli_shutdown(c);
return do_connect(ctx, newserver,
newshare, auth_info,
const char *sharename,
char **pp_newserver,
char **pp_newshare,
- bool force_encrypt,
struct cli_credentials *creds)
{
struct client_dfs_referral *refs = NULL;
char *newextrapath = NULL;
NTSTATUS status;
const char *remote_name;
+ enum smb_encryption_setting encryption_state =
+ cli_credentials_get_smb_encryption(creds);
if (!cli || !sharename) {
return false;
return false;
}
- if (force_encrypt) {
+ if (encryption_state >= SMB_ENCRYPTION_DESIRED) {
status = cli_cm_force_encryption_creds(cli, creds, "IPC$");
if (!NT_STATUS_IS_OK(status)) {
- cli_state_restore_tcon(cli, orig_tcon);
- return false;
+ switch (encryption_state) {
+ case SMB_ENCRYPTION_DESIRED:
+ break;
+ case SMB_ENCRYPTION_REQUIRED:
+ default:
+ cli_state_restore_tcon(cli, orig_tcon);
+ return false;
+ }
}
}
if (smbXcli_conn_dfs_supported(c->conn) &&
cli_check_msdfs_proxy(ctx, c, share,
&newserver, &newshare,
- /* FIXME: cli_check_msdfs_proxy() does
- not support smbc_smb_encrypt_level type */
- context->internal->smb_encryption_level ?
- true : false,
creds)) {
cli_shutdown(c);
srv = SMBC_server_internal(ctx, context, connect_if_not_found,