TALLOC_CTX *ctx = talloc_tos();
char *cmd = talloc_strdup(ctx, cmd_in);
int rc = 0;
+ struct cli_credentials *creds =
+ get_cmdline_auth_info_creds(popt_get_cmdline_auth_info());
if (!cmd) {
return 1;
status = cli_cm_open(talloc_tos(), NULL,
desthost,
- service, popt_get_cmdline_auth_info(),
+ service,
+ creds,
max_protocol,
have_ip ? &dest_ss : NULL, port,
name_type,
{
int rc = 0;
NTSTATUS status;
+ struct cli_credentials *creds =
+ get_cmdline_auth_info_creds(popt_get_cmdline_auth_info());
status = cli_cm_open(talloc_tos(), NULL,
desthost,
- service, popt_get_cmdline_auth_info(),
+ service,
+ creds,
max_protocol,
have_ip ? &dest_ss : NULL, port,
name_type, &cli);
static int do_host_query(const char *query_host)
{
NTSTATUS status;
+ struct cli_credentials *creds =
+ get_cmdline_auth_info_creds(popt_get_cmdline_auth_info());
status = cli_cm_open(talloc_tos(), NULL,
query_host,
- "IPC$", popt_get_cmdline_auth_info(),
+ "IPC$",
+ creds,
max_protocol,
have_ip ? &dest_ss : NULL, port,
name_type, &cli);
d_printf("Reconnecting with SMB1 for workgroup listing.\n");
status = cli_cm_open(talloc_tos(), NULL,
query_host,
- "IPC$", popt_get_cmdline_auth_info(),
+ "IPC$",
+ creds,
max_proto,
have_ip ? &dest_ss : NULL, NBT_SMB_PORT,
name_type, &cli);
{
struct tar *tar_ctx = tar_get_ctx();
int ret = 0;
+ struct cli_credentials *creds =
+ get_cmdline_auth_info_creds(popt_get_cmdline_auth_info());
/* do we already have a connection? */
if (!cli) {
status = cli_cm_open(talloc_tos(), NULL,
desthost,
- service, popt_get_cmdline_auth_info(),
+ service,
+ creds,
max_protocol,
have_ip ? &dest_ss : NULL, port,
name_type, &cli);
struct cli_state *cli_ipc = NULL;
struct client_ipc_connection *p;
NTSTATUS status;
+ struct cli_credentials *creds = NULL;
if (!ctx || !pp || !server_name) {
return WERR_INVALID_PARAMETER;
if (ctx->use_ccache) {
set_cmdline_auth_info_use_ccache(auth_info, true);
}
+ creds = get_cmdline_auth_info_creds(auth_info);
status = cli_cm_open(ctx, NULL,
server_name, "IPC$",
- auth_info,
+ creds,
lp_client_ipc_max_protocol(),
NULL, 0, 0x20, &cli_ipc);
if (!NT_STATUS_IS_OK(status)) {
****************************************************************************/
NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
- struct cli_state *referring_cli,
- const char *server,
- const char *share,
- const struct user_auth_info *auth_info,
- int max_protocol,
- const struct sockaddr_storage *dest_ss,
- int port,
- int name_type,
- struct cli_state **pcli)
+ struct cli_state *referring_cli,
+ const char *server,
+ const char *share,
+ struct cli_credentials *creds,
+ int max_protocol,
+ const struct sockaddr_storage *dest_ss,
+ int port,
+ int name_type,
+ struct cli_state **pcli)
{
/* Try to reuse an existing connection in this list. */
struct cli_state *c = cli_cm_find(referring_cli, server, share);
- struct cli_credentials *creds = get_cmdline_auth_info_creds(auth_info);
NTSTATUS status;
if (c) {
return NT_STATUS_OK;
}
- if (auth_info == NULL) {
+ if (creds == NULL) {
/* Can't do a new connection
* without auth info. */
d_printf("cli_cm_open() Unable to open connection [\\%s\\%s] "
- "without auth info\n",
+ "without client credentials\n",
server, share );
return NT_STATUS_INVALID_PARAMETER;
}
rootcli,
smbXcli_conn_remote_name(rootcli->conn),
"IPC$",
- dfs_auth_info,
+ creds,
smbXcli_conn_protocol(rootcli->conn),
NULL, /* dest_ss not needed, we reuse the transport */
0,
/* The following definitions come from libsmb/clidfs.c */
NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
- struct cli_state *referring_cli,
- const char *server,
- const char *share,
- const struct user_auth_info *auth_info,
- int max_protocol,
- const struct sockaddr_storage *dest_ss,
- int port,
- int name_type,
- struct cli_state **pcli);
+ struct cli_state *referring_cli,
+ const char *server,
+ const char *share,
+ struct cli_credentials *creds,
+ int max_protocol,
+ const struct sockaddr_storage *dest_ss,
+ int port,
+ int name_type,
+ struct cli_state **pcli);
void cli_cm_display(struct cli_state *c);
struct client_dfs_referral;
NTSTATUS cli_dfs_get_referral_ex(TALLOC_CTX *ctx,