char *cmd = talloc_strdup(ctx, cmd_in);
int rc = 0;
struct cli_credentials *creds = samba_cmdline_get_creds();
+ struct smb_transports ts = smbsock_transports_from_port(port);
if (!cmd) {
return 1;
desthost,
service,
creds,
- have_ip ? &dest_ss : NULL, port,
+ have_ip ? &dest_ss : NULL,
+ &ts,
name_type,
&cli);
if (!NT_STATUS_IS_OK(status)) {
int rc = 0;
NTSTATUS status;
struct cli_credentials *creds = samba_cmdline_get_creds();
+ struct smb_transports ts = smbsock_transports_from_port(port);
status = cli_cm_open(talloc_tos(), NULL,
desthost,
service,
creds,
- have_ip ? &dest_ss : NULL, port,
+ have_ip ? &dest_ss : NULL,
+ &ts,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
return 1;
{
NTSTATUS status;
struct cli_credentials *creds = samba_cmdline_get_creds();
+ struct smb_transports ts = smbsock_transports_from_port(port);
status = cli_cm_open(talloc_tos(), NULL,
query_host,
"IPC$",
creds,
- have_ip ? &dest_ss : NULL, port,
+ have_ip ? &dest_ss : NULL,
+ &ts,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
return 1;
if (port != NBT_SMB_PORT ||
smbXcli_conn_protocol(cli->conn) > PROTOCOL_NT1)
{
+ const char *nbt[] = { "nbt", NULL, };
+ struct smb_transports nbt_ts = smb_transports_parse("forced-nbt",
+ nbt);
/*
* Workgroups simply don't make sense over anything
* else but port 139 and SMB1.
query_host,
"IPC$",
creds,
- have_ip ? &dest_ss : NULL, NBT_SMB_PORT,
+ have_ip ? &dest_ss : NULL,
+ &nbt_ts,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
d_printf("Unable to connect with SMB1 "
struct tar *tar_ctx = tar_get_ctx();
int ret = 0;
struct cli_credentials *creds = samba_cmdline_get_creds();
+ struct smb_transports ts = smbsock_transports_from_port(port);
/* do we already have a connection? */
if (!cli) {
desthost,
service,
creds,
- have_ip ? &dest_ss : NULL, port,
+ have_ip ? &dest_ss : NULL,
+ &ts,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
ret = 1;
const char *password = NULL;
NET_API_STATUS rc;
enum credentials_use_kerberos krb5_state;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
if (!ctx || !pp || !server_name) {
return WERR_INVALID_PARAMETER;
status = cli_cm_open(ctx, NULL,
server_name, "IPC$",
ctx->creds,
- NULL, 0, 0x20, &cli_ipc);
+ NULL, &ts, 0x20, &cli_ipc);
if (!NT_STATUS_IS_OK(status)) {
cli_ipc = NULL;
}
const char *share,
struct cli_credentials *creds,
const struct sockaddr_storage *dest_ss,
- int port,
+ const struct smb_transports *transports,
int name_type,
struct cli_state **pcli)
{
struct cli_state *cli = NULL;
NTSTATUS status;
- struct smb_transports ts = smbsock_transports_from_port(port);
status = do_connect(ctx, server, share,
creds,
- dest_ss, &ts, name_type, &cli);
+ dest_ss, transports, name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
return status;
const char *share,
struct cli_credentials *creds,
const struct sockaddr_storage *dest_ss,
- int port,
+ const struct smb_transports *transports,
int name_type,
struct cli_state **pcli)
{
share,
creds,
dest_ss,
- port,
+ transports,
name_type,
&c);
if (!NT_STATUS_IS_OK(status)) {
struct cli_dfs_path_split *dfs_refs = NULL;
bool ok;
bool is_already_dfs = false;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
if ( !rootcli || !path || !targetcli ) {
return NT_STATUS_INVALID_PARAMETER;
"IPC$",
creds,
NULL, /* dest_ss not needed, we reuse the transport */
- 0,
+ &ts,
0x20,
&cli_ipc);
if (!NT_STATUS_IS_OK(status)) {
dfs_refs[count].share,
creds,
NULL, /* dest_ss */
- 0, /* port */
+ &ts,
0x20,
targetcli);
if (!NT_STATUS_IS_OK(status)) {
const char *share,
struct cli_credentials *creds,
const struct sockaddr_storage *dest_ss,
- int port,
+ const struct smb_transports *transports,
int name_type,
- struct cli_state **pcli);
+ struct cli_state **pcli)
+ NONNULL(7) NONNULL(9);
void cli_cm_display(struct cli_state *c);
struct client_dfs_referral;
bool cli_dfs_is_already_full_path(struct cli_state *cli, const char *path);