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

As SMB3 has transport level encryption, allow smbclient -e to force encryted SMB3 transport.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Jeremy Allison
2013-08-16 10:44:34 -07:00
committed by Michael Adam
parent 25521c9085
commit 81e1058e20
3 changed files with 39 additions and 1 deletions

View File

@ -48,7 +48,23 @@ NTSTATUS cli_cm_force_encryption(struct cli_state *c,
const char *domain,
const char *sharename)
{
NTSTATUS status = cli_force_encryption(c,
NTSTATUS status;
if (smbXcli_conn_protocol(c->conn) >= PROTOCOL_SMB2_02) {
status = smb2cli_session_encryption_on(c->smb2.session);
if (NT_STATUS_EQUAL(status,NT_STATUS_NOT_SUPPORTED)) {
d_printf("Encryption required and "
"server doesn't support "
"SMB3 encryption - failing connect\n");
} else if (!NT_STATUS_IS_OK(status)) {
d_printf("Encryption required and "
"setup failed with error %s.\n",
nt_errstr(status));
}
return status;
}
status = cli_force_encryption(c,
username,
password,
domain);