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);
if (get_cmdline_auth_info_use_ccache(auth_info)) {
flags |= CLI_FULL_CONNECTION_USE_CCACHE;
}
+ if (get_cmdline_auth_info_use_pw_nt_hash(auth_info)) {
+ flags |= CLI_FULL_CONNECTION_USE_NT_HASH;
+ }
status = cli_connect_nb(
server, NULL, port, name_type, NULL,
}
DEBUG(4,(" session request ok\n"));
- status = cli_negprot(c, max_protocol);
+ status = smbXcli_negprot(c->conn, c->timeout,
+ lp_cli_minprotocol(),
+ max_protocol);
if (!NT_STATUS_IS_OK(status)) {
d_printf("protocol negotiation failed: %s\n",
return status;
}
+ if (smbXcli_conn_protocol(c->conn) >= PROTOCOL_SMB2_02) {
+ /* Ensure we ask for some initial credits. */
+ smb2cli_conn_set_max_credits(c->conn, DEFAULT_SMB2_MAX_CREDITS);
+ }
+
username = get_cmdline_auth_info_username(auth_info);
password = get_cmdline_auth_info_password(auth_info);
{
/* only deal with DS when we negotiated NT_STATUS codes and UNICODE */
- if (!(smb1cli_conn_capabilities(cli->conn) & CAP_UNICODE)) {
+ if (!(smbXcli_conn_use_unicode(cli->conn))) {
return false;
}
if (!(smb1cli_conn_capabilities(cli->conn) & CAP_STATUS32)) {
}
SSVAL(param, 0, 0x03); /* max referral level */
- param = trans2_bytes_push_str(param, cli_ucs2(cli),
+ param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
path, strlen(path)+1,
NULL);
if (!param) {
"IPC$",
dfs_auth_info,
false,
- cli_state_encryption_on(rootcli),
+ smb1cli_conn_encryption_on(rootcli->conn),
smbXcli_conn_protocol(rootcli->conn),
0,
0x20,
share,
dfs_auth_info,
false,
- cli_state_encryption_on(rootcli),
+ smb1cli_conn_encryption_on(rootcli->conn),
smbXcli_conn_protocol(rootcli->conn),
0,
0x20,