struct cli_credentials *creds = NULL;
/* Start the SMB connection */
- nt_status = cli_start_connection(&cli, myname, server, NULL, port,
- SMB_SIGNING_DEFAULT, 0);
+ nt_status = cli_start_connection(talloc_tos(),
+ &cli,
+ myname,
+ server,
+ NULL,
+ port,
+ SMB_SIGNING_DEFAULT,
+ 0);
if (!NT_STATUS_IS_OK(nt_status)) {
fprintf(stderr, "ERROR: Connection failed: %s\n", nt_errstr(nt_status));
return nt_status;
return NT_STATUS_OK;
}
-NTSTATUS cli_start_connection(struct cli_state **output_cli,
+NTSTATUS cli_start_connection(TALLOC_CTX *mem_ctx,
+ struct cli_state **output_cli,
const char *my_name,
const char *dest_host,
const struct sockaddr_storage *dest_ss, int port,
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- ev = samba_tevent_context_init(talloc_tos());
+ ev = samba_tevent_context_init(mem_ctx);
if (ev == NULL) {
goto fail;
}
if (!tevent_req_poll_ntstatus(req, ev, &status)) {
goto fail;
}
- status = cli_start_connection_recv(req, NULL, output_cli);
+ status = cli_start_connection_recv(req, mem_ctx, output_cli);
fail:
TALLOC_FREE(ev);
return status;
enum smb_signing_setting signing_state,
int flags,
struct cli_state **pcli);
-NTSTATUS cli_start_connection(struct cli_state **output_cli,
+NTSTATUS cli_start_connection(TALLOC_CTX *mem_ctx,
+ struct cli_state **output_cli,
const char *my_name,
const char *dest_host,
const struct sockaddr_storage *dest_ss, int port,
int flags = CLI_FULL_CONNECTION_FORCE_SMB1;
printf("starting chain2 test\n");
- status = cli_start_connection(&cli1, lp_netbios_name(), host, NULL,
- port_to_use, SMB_SIGNING_DEFAULT, flags);
+ status = cli_start_connection(talloc_tos(),
+ &cli1,
+ lp_netbios_name(),
+ host,
+ NULL,
+ port_to_use,
+ SMB_SIGNING_DEFAULT,
+ flags);
if (!NT_STATUS_IS_OK(status)) {
return False;
}