summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-02 18:39:01 -0600
committerStefan Metzmacher <metze@samba.org>2008-01-02 12:48:03 -0600
commit771b347f9b185895390445be96081c781e28a26d (patch)
tree8cbd2b1276c18583af2ade0bc67cc181a11490ad /source4/torture
parent37b822e49f3f7a29950ff6f52cfebf72dd583db9 (diff)
downloadsamba-771b347f9b185895390445be96081c781e28a26d.tar.gz
samba-771b347f9b185895390445be96081c781e28a26d.tar.bz2
samba-771b347f9b185895390445be96081c781e28a26d.zip
r26644: Janitorial: Pass resolve_context explicitly to various SMB functions, should help fix the build for OpenChange.
(This used to be commit 385ffe4f4cc9a21a760c0f00410f56e2592fd507)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/base.c2
-rw-r--r--source4/torture/basic/misc.c3
-rw-r--r--source4/torture/gentest.c5
-rw-r--r--source4/torture/locktest.c5
-rw-r--r--source4/torture/masktest.c8
-rw-r--r--source4/torture/raw/lockbench.c5
-rw-r--r--source4/torture/raw/openbench.c5
-rw-r--r--source4/torture/rpc/join.c3
-rw-r--r--source4/torture/rpc/samba3rpc.c19
-rw-r--r--source4/torture/unix/unix_info2.c4
-rw-r--r--source4/torture/unix/whoami.c4
-rw-r--r--source4/torture/util_smb.c5
12 files changed, 52 insertions, 16 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index cba57ac413..9820a02f27 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -51,7 +51,7 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx)
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;
}
diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c
index 0832556b53..ccff18bfc4 100644
--- a/source4/torture/basic/misc.c
+++ b/source4/torture/basic/misc.c
@@ -822,7 +822,8 @@ static struct composite_context *torture_connect_async(
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)
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index b257f1dc35..9e5ef73ea6 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -25,6 +25,7 @@
#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"
@@ -187,7 +188,9 @@ static bool connect_servers(struct loadparm_context *lp_ctx)
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,
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index 9758cd2cf6..08313b6d57 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -26,6 +26,7 @@
#include "libcli/libcli.h"
#include "param/param.h"
#include "dynconfig.h"
+#include "libcli/resolve/resolve.h"
static int numops = 1000;
static bool showall;
@@ -155,7 +156,9 @@ static struct smbcli_state *connect_one(struct loadparm_context *lp_ctx,
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);
}
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index c88b4f704b..28dfe27960 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -28,6 +28,7 @@
#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;
@@ -72,7 +73,8 @@ static char *reg_test(struct smbcli_state *cli, char *pattern, char *long_name,
/*****************************************************
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;
@@ -90,7 +92,7 @@ static struct smbcli_state *connect_one(char *share, const char **ports)
server,
ports,
share, NULL,
- credentials, NULL);
+ credentials, resolve_ctx, NULL);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
@@ -380,7 +382,7 @@ static void usage(void)
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);
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index 744aab66b1..9131128f81 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -30,6 +30,7 @@
#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"
@@ -197,7 +198,9 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
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);
diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c
index ceb52cdfcf..881f487cb0 100644
--- a/source4/torture/raw/openbench.c
+++ b/source4/torture/raw/openbench.c
@@ -30,6 +30,7 @@
#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"
@@ -136,7 +137,9 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
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);
diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c
index 8ab6ae03ea..dd2912380d 100644
--- a/source4/torture/rpc/join.c
+++ b/source4/torture/rpc/join.c
@@ -5,6 +5,7 @@
#include "auth/credentials/credentials.h"
#include "torture/rpc/rpc.h"
+#include "libcli/resolve/resolve.h"
#include "param/param.h"
#define TORTURE_NETBIOS_NAME "smbtorturejoin"
@@ -34,6 +35,7 @@ bool torture_rpc_join(struct torture_context *torture)
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",
@@ -59,6 +61,7 @@ bool torture_rpc_join(struct torture_context *torture)
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",
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 36461ad629..fd8236544e 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -50,6 +50,7 @@
#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
@@ -82,6 +83,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
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",
@@ -292,6 +294,7 @@ bool torture_bind_samba3(struct torture_context *torture)
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",
@@ -1152,7 +1155,9 @@ bool torture_netlogon_samba3(struct torture_context *torture)
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));
@@ -1234,7 +1239,9 @@ static bool test_join3(struct torture_context *tctx,
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));
@@ -1599,7 +1606,9 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
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));
@@ -1624,7 +1633,9 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
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));
diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c
index d5fe8bc260..9fa0d55c9e 100644
--- a/source4/torture/unix/unix_info2.c
+++ b/source4/torture/unix/unix_info2.c
@@ -26,6 +26,7 @@
#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 {
@@ -58,7 +59,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
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",
diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c
index 412a256da7..4477713bfe 100644
--- a/source4/torture/unix/whoami.c
+++ b/source4/torture/unix/whoami.c
@@ -25,6 +25,7 @@
#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
@@ -78,7 +79,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx,
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",
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index 1168f31679..7d35b1296e 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -31,6 +31,7 @@
#include "torture/torture.h"
#include "util/dlinklist.h"
#include "auth/credentials/credentials.h"
+#include "libcli/resolve/resolve.h"
#include "param/param.h"
@@ -476,7 +477,9 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
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;