#include "lib/messaging/irpc.h"
#include "param/param.h"
-static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, struct netr_SamInfo3 *info3)
+static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, struct winbindd_response *response, struct netr_SamInfo3 *info3)
{
size_t len = response->length - sizeof(struct winbindd_response);
if (len > 4) {
blob.data = (uint8_t *)(((char *)response->extra_data.data) + 4);
ndr_err = ndr_pull_struct_blob(&blob, mem_ctx,
- lp_iconv_convenience(global_loadparm), info3,
+ iconv_convenience, info3,
(ndr_pull_flags_fn_t)ndr_pull_netr_SamInfo3);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
return ndr_map_error2ntstatus(ndr_err);
if (result == NSS_STATUS_SUCCESS && response.extra_data.data) {
union netr_Validation validation;
- nt_status = get_info3_from_ndr(mem_ctx, &response, &info3);
+ nt_status = get_info3_from_ndr(mem_ctx, lp_iconv_convenience(ctx->auth_ctx->lp_ctx), &response, &info3);
SAFE_FREE(response.extra_data.data);
NT_STATUS_NOT_OK_RETURN(nt_status);
#include "system/filesys.h"
#include "auth/gensec/gensec.h"
#include "lib/cmdline/popt_common.h"
+#include "libcli/resolve/resolve.h"
#include "cifsdd.h"
#include "param/param.h"
}
}
-static struct dd_iohandle * open_file(const char * which, const char **ports)
+static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
+ const char * which, const char **ports)
{
int options = 0;
const char * path = NULL;
if (strcmp(which, "if") == 0) {
path = check_arg_pathname("if");
- handle = dd_open_path(path, ports, check_arg_numeric("ibs"),
- options);
+ handle = dd_open_path(resolve_ctx, path, ports,
+ check_arg_numeric("ibs"), options);
} else if (strcmp(which, "of") == 0) {
options |= DD_WRITE;
path = check_arg_pathname("of");
- handle = dd_open_path(path, ports, check_arg_numeric("obs"),
- options);
+ handle = dd_open_path(resolve_ctx, path, ports,
+ check_arg_numeric("obs"), options);
} else {
SMB_ASSERT(0);
return(NULL);
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
(unsigned long long)iomax, lp_max_xmit(lp_ctx)));
- if (!(ifile = open_file("if", lp_smb_ports(lp_ctx)))) {
+ if (!(ifile = open_file(lp_resolve_context(lp_ctx), "if",
+ lp_smb_ports(lp_ctx)))) {
return(FILESYS_EXIT_CODE);
}
- if (!(ofile = open_file("of", lp_smb_ports(lp_ctx)))) {
+ if (!(ofile = open_file(lp_resolve_context(lp_ctx), "of",
+ lp_smb_ports(lp_ctx)))) {
return(FILESYS_EXIT_CODE);
}
#define DD_WRITE 0x00000004
#define DD_OPLOCK 0x00000008
-struct dd_iohandle * dd_open_path(const char * path,
+struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
+ const char * path,
const char **ports,
uint64_t io_size, int options);
bool dd_fill_block(struct dd_iohandle * h, uint8_t * buf,
return(true);
}
-static struct smbcli_state * init_smb_session(const char * host,
+static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ctx,
+ const char * host,
const char **ports,
const char * share)
{
* each connection, but for now, we just use the same one for both.
*/
ret = smbcli_full_connection(NULL, &cli, host, ports, share,
- NULL /* devtype */, cmdline_credentials, NULL /* events */);
+ NULL /* devtype */, cmdline_credentials, resolve_ctx,
+ NULL /* events */);
if (!NT_STATUS_IS_OK(ret)) {
fprintf(stderr, "%s: connecting to //%s/%s: %s\n",
return(o.ntcreatex.out.file.fnum);
}
-static struct dd_iohandle * open_cifs_handle(const char * host,
+static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx,
+ const char * host,
const char **ports,
const char * share,
const char * path,
smbh->h.io_write = smb_write_func;
smbh->h.io_seek = smb_seek_func;
- if ((smbh->cli = init_smb_session(host, ports, share)) == NULL) {
+ if ((smbh->cli = init_smb_session(resolve_ctx, host, ports, share)) == NULL) {
return(NULL);
}
/* Abstract IO interface. */
/* ------------------------------------------------------------------------- */
-struct dd_iohandle * dd_open_path(const char * path,
+struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
+ const char * path,
const char **ports,
uint64_t io_size,
int options)
/* Skip over leading directory separators. */
while (*remain == '/' || *remain == '\\') { remain++; }
- return(open_cifs_handle(host, ports, share, remain,
+ return(open_cifs_handle(resolve_ctx, host, ports,
+ share, remain,
io_size, options));
}
/*****************************************************
return a connection to a server
*******************************************************/
-static bool do_connect(struct smbclient_context *ctx,
+static bool do_connect(struct smbclient_context *ctx,
+ struct resolve_context *resolve_ctx,
const char *specified_server, const char **ports, const char *specified_share, struct cli_credentials *cred)
{
NTSTATUS status;
ctx->remote_cur_dir = talloc_strdup(ctx, "\\");
status = smbcli_full_connection(ctx, &ctx->cli, server, ports,
- share, NULL, cred,
+ share, NULL, cred, resolve_ctx,
cli_credentials_get_event_context(cred));
if (!NT_STATUS_IS_OK(status)) {
d_printf("Connection to \\\\%s\\%s failed - %s\n",
/****************************************************************************
handle a message operation
****************************************************************************/
-static int do_message_op(const char *netbios_name, const char *desthost, const char **destports, const char *destip, int name_type, struct resolve_context *resolve_ctx, int max_xmit, int max_mux)
+static int do_message_op(const char *netbios_name, const char *desthost, const char **destports, const char *destip, int name_type, struct resolve_context *resolve_ctx, int max_xmit, int max_mux, bool use_spnego)
{
struct nbt_name called, calling;
const char *server_name;
server_name = destip ? destip : desthost;
- if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, resolve_ctx, max_xmit, max_mux)) {
+ if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, resolve_ctx, max_xmit, max_mux, use_spnego)) {
d_printf("Connection to %s failed\n", server_name);
return 1;
}
}
if (message) {
- return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, lp_resolve_context(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx));
+ return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, lp_resolve_context(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx), lp_nt_status_support(cmdline_lp_ctx) && lp_use_spnego(cmdline_lp_ctx));
}
- if (!do_connect(ctx, desthost, lp_smb_ports(cmdline_lp_ctx), service, cmdline_credentials))
+ if (!do_connect(ctx, lp_resolve_context(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), service, cmdline_credentials))
return 1;
if (base_directory)
*/
bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
const char **ports, struct resolve_context *resolve_ctx,
- int max_xmit, int max_mux)
+ int max_xmit, int max_mux, bool use_spnego)
{
struct smbcli_socket *sock;
if (sock == NULL) return false;
cli->transport = smbcli_transport_init(sock, cli, true, max_xmit,
- max_mux);
+ max_mux, use_spnego);
if (!cli->transport) {
return false;
}
const char *sharename,
const char *devtype,
struct cli_credentials *credentials,
+ struct resolve_context *resolve_ctx,
struct event_context *ev)
{
struct smbcli_tree *tree;
status = smbcli_tree_full_connection(parent_ctx,
&tree, host, ports,
sharename, devtype,
- credentials, ev);
+ credentials, resolve_ctx, ev);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
const char *host_addr,
const char **ports,
const char *host_name,
+ struct resolve_context *resolve_ctx,
struct event_context *event_ctx)
{
struct composite_context *result, *ctx;
NTSTATUS smbcli_sock_connect(TALLOC_CTX *mem_ctx,
const char *host_addr, const char **ports,
const char *host_name,
+ struct resolve_context *resolve_ctx,
struct event_context *event_ctx,
struct smbcli_socket **result)
{
struct composite_context *c =
smbcli_sock_connect_send(mem_ctx, host_addr, ports, host_name,
+ resolve_ctx,
event_ctx);
return smbcli_sock_connect_recv(c, mem_ctx, result);
}
return NULL;
}
- status = smbcli_sock_connect(mem_ctx, address, ports, name, event_ctx,
- &result);
+ status = smbcli_sock_connect(mem_ctx, address, ports, name, resolve_ctx,
+ event_ctx, &result);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(9, ("smbcli_sock_connect failed: %s\n",
TALLOC_CTX *parent_ctx,
bool primary,
int max_xmit,
- int max_mux)
+ int max_mux,
+ bool use_spnego)
{
struct smbcli_transport *transport;
transport->socket = talloc_reference(transport, sock);
}
transport->negotiate.protocol = PROTOCOL_NT1;
- transport->options.use_spnego = lp_use_spnego(global_loadparm) &&
- lp_nt_status_support(global_loadparm);
+ transport->options.use_spnego = use_spnego;
transport->options.max_xmit = max_xmit;
transport->options.max_mux = max_mux;
transport->options.request_timeout = SMB_REQUEST_TIMEOUT;
const char *dest_host, const char **dest_ports,
const char *service, const char *service_type,
struct cli_credentials *credentials,
+ struct resolve_context *resolve_ctx,
struct event_context *ev)
{
struct smb_composite_connect io;
io.in.fallback_to_anonymous = false;
io.in.workgroup = lp_workgroup(global_loadparm);
- status = smb_composite_connect(&io, parent_ctx, ev);
+ status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev);
if (NT_STATUS_IS_OK(status)) {
*ret_tree = io.out.tree;
}
struct smb2_connect_state {
struct cli_credentials *credentials;
+ struct resolve_context *resolve_ctx;
const char *host;
const char *share;
struct smb2_negprot negprot;
c->status = resolve_name_recv(creq, state, &addr);
if (!composite_is_ok(c)) return;
- creq = smbcli_sock_connect_send(state, addr, ports, state->host, c->event_ctx);
+ creq = smbcli_sock_connect_send(state, addr, ports, state->host, state->resolve_ctx, c->event_ctx);
composite_continue(c, creq, continue_socket, c);
}
if (composite_nomem(state->host, c)) return c;
state->share = talloc_strdup(c, share);
if (composite_nomem(state->share, c)) return c;
+ state->resolve_ctx = talloc_reference(state, resolve_ctx);
ZERO_STRUCT(name);
name.name = host;
/* the socket is up - we can initialise the smbcli transport layer */
state->transport = smbcli_transport_init(state->sock, state, true,
lp_max_xmit(global_loadparm),
- lp_maxmux(global_loadparm));
+ lp_maxmux(global_loadparm),
+ lp_use_spnego(global_loadparm) && lp_nt_status_support(global_loadparm));
NT_STATUS_HAVE_NO_MEMORY(state->transport);
if (is_ipaddress(state->sock->hostname) &&
state->creq = smbcli_sock_connect_send(state, address,
io->in.dest_ports,
- io->in.dest_host, c->event_ctx);
+ io->in.dest_host,
+ NULL, c->event_ctx);
NT_STATUS_HAVE_NO_MEMORY(state->creq);
state->stage = CONNECT_SOCKET;
*/
struct composite_context *smb_composite_connect_send(struct smb_composite_connect *io,
TALLOC_CTX *mem_ctx,
+ struct resolve_context *resolve_ctx,
struct event_context *event_ctx)
{
struct composite_context *c;
state->stage = CONNECT_RESOLVE;
make_nbt_name_server(&name, io->in.dest_host);
- state->creq = resolve_name_send(lp_resolve_context(global_loadparm), &name, c->event_ctx);
+ state->creq = resolve_name_send(resolve_ctx, &name, c->event_ctx);
if (state->creq == NULL) goto failed;
state->creq->async.private_data = c;
sync version of smb_composite_connect
*/
NTSTATUS smb_composite_connect(struct smb_composite_connect *io, TALLOC_CTX *mem_ctx,
+ struct resolve_context *resolve_ctx,
struct event_context *ev)
{
- struct composite_context *c = smb_composite_connect_send(io, mem_ctx, ev);
+ struct composite_context *c = smb_composite_connect_send(io, mem_ctx, resolve_ctx, ev);
return smb_composite_connect_recv(c, mem_ctx);
}
#include "includes.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
+#include "param/param.h"
+#include "libcli/resolve/resolve.h"
enum fetchfile_stage {FETCHFILE_CONNECT,
FETCHFILE_READ};
state->connect->in.fallback_to_anonymous = false;
state->connect->in.workgroup = io->in.workgroup;
- state->creq = smb_composite_connect_send(state->connect, state, event_ctx);
+ state->creq = smb_composite_connect_send(state->connect, state,
+ lp_resolve_context(global_loadparm), event_ctx);
if (state->creq == NULL) goto failed;
state->creq->async.private_data = c;
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
+#include "param/param.h"
+#include "libcli/resolve/resolve.h"
/* the stages of this call */
enum fsinfo_stage {FSINFO_CONNECT, FSINFO_QUERY};
c->private_data = state;
state->creq = smb_composite_connect_send(state->connect, state,
- c->event_ctx);
+ lp_resolve_context(global_loadparm), c->event_ctx);
if (state->creq == NULL) goto failed;
};
struct smbcli_session;
+struct resolve_context;
#include "libcli/smb_composite/proto.h"
}
/* send smb connect request */
- conn_req = smb_composite_connect_send(conn, s->io.pipe->conn, s->io.pipe->conn->event_ctx);
+ conn_req = smb_composite_connect_send(conn, s->io.pipe->conn,
+ lp_resolve_context(lp_ctx),
+ s->io.pipe->conn->event_ctx);
if (composite_nomem(conn_req, c)) return c;
composite_continue(c, conn_req, continue_smb_connect, c);
#include "ntvfs/ntvfs.h"
#include "lib/util/dlinklist.h"
#include "param/param.h"
+#include "libcli/resolve/resolve.h"
struct cvfs_file {
struct cvfs_file *prev, *next;
io.in.service = remote_share;
io.in.service_type = "?????";
- creq = smb_composite_connect_send(&io, private, ntvfs->ctx->event_ctx);
+ creq = smb_composite_connect_send(&io, private,
+ lp_resolve_context(ntvfs->ctx->lp_ctx),
+ ntvfs->ctx->event_ctx);
status = smb_composite_connect_recv(creq, private);
NT_STATUS_NOT_OK_RETURN(status);
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "libcli/libcli.h"
+#include "libcli/resolve/resolve.h"
#include "auth/credentials/credentials.h"
#include "param/param.h"
io.in.fallback_to_anonymous = false;
io.in.workgroup = lp_workgroup(global_loadparm);
- result = smb_composite_connect(&io, mem_ctx, NULL);
+ result = smb_composite_connect(&io, mem_ctx,
+ lp_resolve_context(global_loadparm),
+ NULL);
tree = io.out.tree;
talloc_free(mem_ctx);
goto failed;
}
- if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), lp_resolve_context(tctx->lp_ctx), lp_max_xmit(tctx->lp_ctx), lp_maxmux(tctx->lp_ctx))) {
+ if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), lp_resolve_context(tctx->lp_ctx), lp_max_xmit(tctx->lp_ctx), lp_maxmux(tctx->lp_ctx), lp_nt_status_support(tctx->lp_ctx) && lp_use_spnego(tctx->lp_ctx))) {
torture_comment(tctx, "Failed to connect with %s\n", host);
goto failed;
}
smb->in.fallback_to_anonymous=false;
smb->in.workgroup=workgroup;
- return smb_composite_connect_send(smb,mem_ctx,ev);
+ return smb_composite_connect_send(smb,mem_ctx,
+ lp_resolve_context(tctx->lp_ctx),ev);
}
bool run_benchrw(struct torture_context *tctx)
#include "libcli/raw/libcliraw.h"
#include "librpc/gen_ndr/security.h"
#include "auth/credentials/credentials.h"
+#include "libcli/resolve/resolve.h"
#include "auth/gensec/gensec.h"
#include "param/param.h"
#include "dynconfig.h"
servers[i].server_name,
lp_smb_ports(lp_ctx),
servers[i].share_name, NULL,
- servers[i].credentials, NULL);
+ servers[i].credentials,
+ lp_resolve_context(lp_ctx),
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
servers[i].server_name, servers[i].share_name,
#include "libcli/libcli.h"
#include "param/param.h"
#include "dynconfig.h"
+#include "libcli/resolve/resolve.h"
static int numops = 1000;
static bool showall;
server,
lp_smb_ports(lp_ctx),
share, NULL,
- servers[snum], NULL);
+ servers[snum],
+ lp_resolve_context(lp_ctx),
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
sleep(2);
}
#include "auth/gensec/gensec.h"
#include "param/param.h"
#include "dynconfig.h"
+#include "libcli/resolve/resolve.h"
static struct cli_credentials *credentials;
static bool showall = false;
/*****************************************************
return a connection to a server
*******************************************************/
-static struct smbcli_state *connect_one(char *share, const char **ports)
+static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
+ char *share, const char **ports)
{
struct smbcli_state *c;
fstring server;
server,
ports,
share, NULL,
- credentials, NULL);
+ credentials, resolve_ctx, NULL);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
argc -= optind;
argv += optind;
- cli = connect_one(share, lp_smb_ports(lp_ctx));
+ cli = connect_one(lp_resolve_context(lp_ctx), share, lp_smb_ports(lp_ctx));
if (!cli) {
DEBUG(0,("Failed to connect to %s\n", share));
exit(1);
#include "lib/cmdline/popt_common.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
+#include "libcli/resolve/resolve.h"
#include "param/param.h"
#define BASEDIR "\\benchlock"
talloc_free(state->tree);
state->tree = NULL;
- ctx = smb_composite_connect_send(io, state->mem_ctx, state->ev);
+ ctx = smb_composite_connect_send(io, state->mem_ctx,
+ lp_resolve_context(state->tctx->lp_ctx),
+ state->ev);
if (ctx == NULL) {
DEBUG(0,("Failed to setup async reconnect\n"));
exit(1);
#include "lib/cmdline/popt_common.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
+#include "libcli/resolve/resolve.h"
#include "param/param.h"
#define BASEDIR "\\benchopen"
state->tree = NULL;
state->fnum = -1;
- ctx = smb_composite_connect_send(io, state->mem_ctx, state->ev);
+ ctx = smb_composite_connect_send(io, state->mem_ctx,
+ lp_resolve_context(state->tctx->lp_ctx),
+ state->ev);
if (ctx == NULL) {
DEBUG(0,("Failed to setup async reconnect\n"));
exit(1);
#include "auth/credentials/credentials.h"
#include "torture/rpc/rpc.h"
+#include "libcli/resolve/resolve.h"
#include "param/param.h"
#define TORTURE_NETBIOS_NAME "smbtorturejoin"
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL,
machine_account,
+ lp_resolve_context(torture->lp_ctx),
NULL);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL,
machine_account,
+ lp_resolve_context(torture->lp_ctx),
NULL);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
#include "libcli/security/proto.h"
#include "param/param.h"
#include "lib/registry/registry.h"
+#include "libcli/resolve/resolve.h"
/*
* This tests a RPC call using an invalid vuid
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
+ lp_resolve_context(torture->lp_ctx),
NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
+ lp_resolve_context(torture->lp_ctx),
NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
- "IPC$", NULL, anon_creds, NULL);
+ "IPC$", NULL, anon_creds,
+ lp_resolve_context(torture->lp_ctx),
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
status = smbcli_full_connection(tctx, &cli,
torture_setting_string(tctx, "host", NULL),
lp_smb_ports(tctx->lp_ctx),
- "IPC$", NULL, smb_creds, NULL);
+ "IPC$", NULL, smb_creds,
+ lp_resolve_context(tctx->lp_ctx),
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
- "IPC$", NULL, cmdline_credentials, NULL);
+ "IPC$", NULL, cmdline_credentials,
+ lp_resolve_context(torture->lp_ctx),
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
- "IPC$", NULL, anon_creds, NULL);
+ "IPC$", NULL, anon_creds,
+ lp_resolve_context(torture->lp_ctx),
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) anon smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
#include "torture/basic/proto.h"
#include "lib/cmdline/popt_common.h"
#include "auth/credentials/credentials.h"
+#include "libcli/resolve/resolve.h"
#include "param/param.h"
struct unix_info2 {
status = smbcli_full_connection(tctx, &cli, host,
lp_smb_ports(tctx->lp_ctx),
share, NULL,
- cmdline_credentials, NULL);
+ cmdline_credentials,
+ lp_resolve_context(tctx->lp_ctx), NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
#include "lib/cmdline/popt_common.h"
#include "auth/credentials/credentials.h"
#include "param/param.h"
+#include "libcli/resolve/resolve.h"
/* Size (in bytes) of the required fields in the SMBwhoami response. */
#define WHOAMI_REQUIRED_SIZE 40
status = smbcli_full_connection(tctx, &cli, host,
lp_smb_ports(tctx->lp_ctx),
share, NULL,
- creds, NULL);
+ creds, lp_resolve_context(tctx->lp_ctx),
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
#include "torture/torture.h"
#include "util/dlinklist.h"
#include "auth/credentials/credentials.h"
+#include "libcli/resolve/resolve.h"
#include "param/param.h"
status = smbcli_full_connection(mem_ctx, c, hostname,
lp_smb_ports(tctx->lp_ctx),
sharename, NULL,
- cmdline_credentials, ev);
+ cmdline_credentials,
+ lp_resolve_context(tctx->lp_ctx),
+ ev);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;