summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-09-30 13:02:09 -0700
committerAndrew Tridgell <tridge@samba.org>2008-09-30 13:02:09 -0700
commitf84093df863eb00238a6be1caba59d926f18e7a5 (patch)
treef72c5aa9bfae972a5a376767a271eac5d5ded085 /source4/torture
parentef6fc37add1fd9164eb143c953fde0d5a9fc584a (diff)
parent687ce0b60a3913b0f2eca2365a5ab56e78523ab5 (diff)
downloadsamba-f84093df863eb00238a6be1caba59d926f18e7a5.tar.gz
samba-f84093df863eb00238a6be1caba59d926f18e7a5.tar.bz2
samba-f84093df863eb00238a6be1caba59d926f18e7a5.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/misc.c1
-rw-r--r--source4/torture/basic/secleak.c5
-rw-r--r--source4/torture/config.mk2
-rw-r--r--source4/torture/gentest.c5
-rw-r--r--source4/torture/locktest.c4
-rw-r--r--source4/torture/locktest2.c19
-rw-r--r--source4/torture/masktest.c9
-rw-r--r--source4/torture/raw/composite.c3
-rw-r--r--source4/torture/raw/context.c26
-rw-r--r--source4/torture/raw/lock.c5
-rw-r--r--source4/torture/raw/lockbench.c1
-rw-r--r--source4/torture/raw/notify.c37
-rw-r--r--source4/torture/raw/openbench.c1
-rw-r--r--source4/torture/raw/oplock.c5
-rw-r--r--source4/torture/raw/tconrate.c4
-rw-r--r--source4/torture/rpc/join.c6
-rw-r--r--source4/torture/rpc/lsa.c6
-rw-r--r--source4/torture/rpc/object_uuid.c87
-rw-r--r--source4/torture/rpc/rpc.c1
-rw-r--r--source4/torture/rpc/samba3rpc.c26
-rw-r--r--source4/torture/rpc/samlogon.c8
-rw-r--r--source4/torture/unix/unix_info2.c4
-rw-r--r--source4/torture/unix/whoami.c4
-rw-r--r--source4/torture/util_smb.c4
24 files changed, 211 insertions, 62 deletions
diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c
index 24e0324bc3..c129fd586b 100644
--- a/source4/torture/basic/misc.c
+++ b/source4/torture/basic/misc.c
@@ -823,6 +823,7 @@ static struct composite_context *torture_connect_async(
smb->in.fallback_to_anonymous=false;
smb->in.workgroup=workgroup;
lp_smbcli_options(tctx->lp_ctx, &smb->in.options);
+ lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options);
return smb_composite_connect_send(smb,mem_ctx,
lp_resolve_context(tctx->lp_ctx),ev);
diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c
index 4caeee72a4..ca1fd444d9 100644
--- a/source4/torture/basic/secleak.c
+++ b/source4/torture/basic/secleak.c
@@ -36,8 +36,11 @@ static bool try_failed_login(struct torture_context *tctx, struct smbcli_state *
NTSTATUS status;
struct smb_composite_sesssetup setup;
struct smbcli_session *session;
+ struct smbcli_session_options options;
- session = smbcli_session_init(cli->transport, cli, false);
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
+ session = smbcli_session_init(cli->transport, cli, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index 96da10b5df..211d09756d 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -116,7 +116,7 @@ torture_rpc_OBJ_FILES = $(addprefix $(torturesrcdir)/rpc/, \
eventlog.o epmapper.o winreg.o initshutdown.o oxidresolve.o remact.o mgmt.o \
scanner.o autoidl.o countcalls.o testjoin.o schannel.o netlogon.o remote_pac.o samlogon.o \
samsync.o bind.o dssetup.o alter_context.o bench.o samba3rpc.o rpc.o async_bind.o \
- handles.o frsapi.o)
+ handles.o frsapi.o object_uuid.o)
$(eval $(call proto_header_template,$(torturesrcdir)/rpc/proto.h,$(torture_rpc_OBJ_FILES:.o=.c)))
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index fecdfda56e..3bf3ad8b1b 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -214,7 +214,9 @@ static bool connect_servers(struct event_context *ev,
for (j=0;j<NINSTANCES;j++) {
NTSTATUS status;
struct smbcli_options smb_options;
+ struct smbcli_session_options smb_session_options;
lp_smbcli_options(lp_ctx, &smb_options);
+ lp_smbcli_session_options(lp_ctx, &smb_session_options);
printf("Connecting to \\\\%s\\%s as %s - instance %d\n",
servers[i].server_name, servers[i].share_name,
@@ -238,7 +240,8 @@ static bool connect_servers(struct event_context *ev,
servers[i].share_name, "A:",
servers[i].credentials,
lp_resolve_context(lp_ctx), ev,
- &smb_options);
+ &smb_options,
+ &smb_session_options);
}
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index 9c7bffb6f4..a511e261cb 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -117,8 +117,10 @@ static struct smbcli_state *connect_one(struct event_context *ev,
NTSTATUS status;
int retries = 10;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(lp_ctx, &options);
+ lp_smbcli_session_options(lp_ctx, &session_options);
printf("connect_one(%s, %d, %d)\n", share, snum, conn);
@@ -164,7 +166,7 @@ static struct smbcli_state *connect_one(struct event_context *ev,
share, NULL,
servers[snum],
lp_resolve_context(lp_ctx),
- ev, &options);
+ ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
sleep(2);
}
diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c
index e6c4728f0d..b49b8d256a 100644
--- a/source4/torture/locktest2.c
+++ b/source4/torture/locktest2.c
@@ -138,7 +138,8 @@ static bool try_unlock(struct smbcli_state *c, int fstype,
return a connection to a server
*******************************************************/
static struct smbcli_state *connect_one(char *share, const char **ports,
- struct smb_options *optionsi,
+ struct smb_options *options,
+ struct smb_options *session_options,
struct event_context *ev)
{
struct smbcli_state *c;
@@ -168,7 +169,7 @@ static struct smbcli_state *connect_one(char *share, const char **ports,
nt_status = smbcli_full_connection(NULL,
&c, myname, server_n, ports, share, NULL,
username, lp_workgroup(), password, ev,
- options);
+ options, session_options);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status)));
return NULL;
@@ -185,6 +186,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
const char **ports,
struct smbcli_options *options,
+ struct smbcli_session_options *session_options,
struct event_context *ev,
char *share1, char *share2)
{
@@ -204,7 +206,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
smbcli_ulogoff(cli[server][conn]);
talloc_free(cli[server][conn]);
}
- cli[server][conn] = connect_one(share[server], ports, options, ev);
+ cli[server][conn] = connect_one(share[server], ports, options, session_options, ev);
if (!cli[server][conn]) {
DEBUG(0,("Failed to connect to %s\n", share[server]));
exit(1);
@@ -354,6 +356,7 @@ static void test_locks(char *share1, char *share2,
char *nfspath1, char *nfspath2,
const char **ports,
struct smbcli_options *options,
+ struct smbcli_session_options *session_options,
struct event_context *ev)
{
struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
@@ -383,7 +386,7 @@ static void test_locks(char *share1, char *share2,
recorded[n].needed = true;
}
- reconnect(cli, nfs, fnum, ports, options, ev, share1, share2);
+ reconnect(cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
open_files(cli, nfs, fnum);
n = retest(cli, nfs, fnum, numops);
@@ -394,7 +397,7 @@ static void test_locks(char *share1, char *share2,
n1 = n;
close_files(cli, nfs, fnum);
- reconnect(cli, nfs, fnum, ports, options, ev, share1, share2);
+ reconnect(cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
open_files(cli, nfs, fnum);
for (i=0;i<n-1;i++) {
@@ -421,7 +424,7 @@ static void test_locks(char *share1, char *share2,
}
close_files(cli, nfs, fnum);
- reconnect(cli, nfs, fnum, ports, options, ev, share1, share2);
+ reconnect(cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
open_files(cli, nfs, fnum);
showall = true;
n1 = retest(cli, nfs, fnum, n);
@@ -469,6 +472,7 @@ static void usage(void)
extern char *optarg;
extern int optind;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
int opt;
char *p;
int seed;
@@ -554,8 +558,9 @@ static void usage(void)
locking_init(1);
lp_smbcli_options(lp_ctx, &options);
+ lp_smbcli_session_options(lp_ctx, &session_options);
test_locks(share1, share2, nfspath1, nfspath2, lp_smb_ports(lp_ctx),
- &options, ev);
+ &options, &session_options, ev);
return(0);
}
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 35e9a57fe8..a739a1e1b5 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -76,7 +76,8 @@ return a connection to a server
static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
struct event_context *ev,
char *share, const char **ports,
- struct smbcli_options *options)
+ struct smbcli_options *options,
+ struct smbcli_session_options *session_options)
{
struct smbcli_state *c;
fstring server;
@@ -95,7 +96,7 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
ports,
share, NULL,
cmdline_credentials, resolve_ctx, ev,
- options);
+ options, session_options);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
@@ -296,6 +297,7 @@ static void usage(poptContext pc)
struct event_context *ev;
struct loadparm_context *lp_ctx;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
poptContext pc;
int argc_new, i;
char **argv_new;
@@ -360,9 +362,10 @@ static void usage(poptContext pc)
gensec_init(lp_ctx);
lp_smbcli_options(lp_ctx, &options);
+ lp_smbcli_session_options(lp_ctx, &session_options);
cli = connect_one(lp_resolve_context(lp_ctx), ev, share,
- lp_smb_ports(lp_ctx), &options);
+ lp_smb_ports(lp_ctx), &options, &session_options);
if (!cli) {
DEBUG(0,("Failed to connect to %s\n", share));
exit(1);
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index d73ac1327e..7f1f5943e1 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -164,6 +164,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct
io2.in.filename = fname;
io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx);
lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
+ lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
printf("testing parallel fetchfile with %d ops\n", torture_numops);
@@ -358,7 +359,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx)
c = talloc_array(tctx, struct composite_context *, torture_numops);
for (i=0; i<torture_numops; i++) {
- c[i] = smb_composite_fsinfo_send(cli->tree,&io1);
+ c[i] = smb_composite_fsinfo_send(cli->tree, &io1, lp_resolve_context(tctx->lp_ctx));
c[i]->async.fn = loadfile_complete;
c[i]->async.private_data = count;
}
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 15e736fff5..450ad0f260 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -81,6 +81,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
const char *fname = BASEDIR "\\test.txt";
uint8_t c = 1;
int i;
+ struct smbcli_session_options options;
printf("TESTING SESSION HANDLING\n");
@@ -89,7 +90,10 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
}
printf("create a second security context on the same transport\n");
- session = smbcli_session_init(cli->transport, tctx, false);
+
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
+ session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
@@ -103,7 +107,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
session->vuid = setup.out.vuid;
printf("create a third security context on the same transport, with vuid set\n");
- session2 = smbcli_session_init(cli->transport, tctx, false);
+ session2 = smbcli_session_init(cli->transport, tctx, false, options);
session2->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -130,7 +134,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
printf("create a fourth security context on the same transport, without extended security\n");
- session3 = smbcli_session_init(cli->transport, tctx, false);
+ session3 = smbcli_session_init(cli->transport, tctx, false, options);
session3->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -144,7 +148,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
CHECK_STATUS(status, NT_STATUS_LOGON_FAILURE);
printf("create a fouth anonymous security context on the same transport, without extended security\n");
- session4 = smbcli_session_init(cli->transport, tctx, false);
+ session4 = smbcli_session_init(cli->transport, tctx, false, options);
session4->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -230,7 +234,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
setups[i].in.credentials = cmdline_credentials;
- sessions[i] = smbcli_session_init(cli->transport, tctx, false);
+ sessions[i] = smbcli_session_init(cli->transport, tctx, false, options);
composite_contexts[i] = smb_composite_sesssetup_send(sessions[i], &setups[i]);
}
@@ -379,6 +383,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
const char *fname1 = BASEDIR "\\test1.txt";
const char *fname2 = BASEDIR "\\test2.txt";
uint8_t c = 1;
+ struct smbcli_session_options options;
printf("TESTING TREE with ulogoff\n");
@@ -389,8 +394,10 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
share = torture_setting_string(tctx, "share", NULL);
host = torture_setting_string(tctx, "host", NULL);
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
printf("create the first new sessions\n");
- session1 = smbcli_session_init(cli->transport, tctx, false);
+ session1 = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
@@ -446,7 +453,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
CHECK_STATUS(status, NT_STATUS_OK);
printf("create the second new sessions\n");
- session2 = smbcli_session_init(cli->transport, tctx, false);
+ session2 = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
@@ -634,6 +641,7 @@ static bool test_pid_2sess(struct smbcli_state *cli, struct torture_context *tct
const char *fname = BASEDIR "\\test.txt";
uint8_t c = 1;
uint16_t vuid1, vuid2;
+ struct smbcli_session_options options;
printf("TESTING PID HANDLING WITH 2 SESSIONS\n");
@@ -641,8 +649,10 @@ static bool test_pid_2sess(struct smbcli_state *cli, struct torture_context *tct
return false;
}
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
printf("create a second security context on the same transport\n");
- session = smbcli_session_init(cli->transport, tctx, false);
+ session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c
index cd8d606795..dbe071c9ad 100644
--- a/source4/torture/raw/lock.c
+++ b/source4/torture/raw/lock.c
@@ -456,11 +456,14 @@ static bool test_async(struct torture_context *tctx,
const char *fname = BASEDIR "\\test.txt";
time_t t;
struct smbcli_request *req;
+ struct smbcli_session_options options;
if (!torture_setup_dir(cli, BASEDIR)) {
return false;
}
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
printf("Testing LOCKING_ANDX_CANCEL_LOCK\n");
io.generic.level = RAW_LOCK_LOCKX;
@@ -590,7 +593,7 @@ static bool test_async(struct torture_context *tctx,
}
printf("create a new sessions\n");
- session = smbcli_session_init(cli->transport, tctx, false);
+ session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index 21541d003b..26fad4235e 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -195,6 +195,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.fallback_to_anonymous = false;
io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
+ lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
/* kill off the remnants of the old connection */
talloc_free(state->tree);
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index 25c91eb88b..d7541b7c71 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -583,7 +583,9 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.recursive = true;
-#define NOTIFY_MASK_TEST(setup, op, cleanup, Action, expected, nchanges) \
+#define NOTIFY_MASK_TEST(test_name, setup, op, cleanup, Action, expected, nchanges) \
+ do { \
+ smbcli_getatr(cli->tree, test_name, NULL, NULL, NULL); \
do { for (mask=i=0;i<32;i++) { \
struct smbcli_request *req; \
status = smb_raw_open(cli->tree, tctx, &io); \
@@ -640,24 +642,25 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
mask, expected); \
} \
} \
- } while (0)
+ } while (0); \
+ } while (0);
printf("testing mkdir\n");
- NOTIFY_MASK_TEST(;,
+ NOTIFY_MASK_TEST("testing mkdir",;,
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
smbcli_rmdir(cli->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
printf("testing create file\n");
- NOTIFY_MASK_TEST(;,
+ NOTIFY_MASK_TEST("testing create file",;,
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
printf("testing unlink\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing unlink",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
;,
@@ -665,7 +668,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
printf("testing rmdir\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing rmdir",
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
smbcli_rmdir(cli->tree, BASEDIR "\\tname1");,
;,
@@ -673,7 +676,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
printf("testing rename file\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing rename file",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_rename(cli->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
smbcli_unlink(cli->tree, BASEDIR "\\tname2");,
@@ -681,7 +684,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_ATTRIBUTES|FILE_NOTIFY_CHANGE_CREATION, 2);
printf("testing rename dir\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing rename dir",
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
smbcli_rename(cli->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
smbcli_rmdir(cli->tree, BASEDIR "\\tname2");,
@@ -689,7 +692,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_DIR_NAME, 2);
printf("testing set path attribute\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set path attribute",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
@@ -697,7 +700,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
printf("testing set path write time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set path write time",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_NORMAL, 1000);,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
@@ -705,7 +708,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_LAST_WRITE, 1);
printf("testing set file attribute\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file attribute",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, FILE_ATTRIBUTE_HIDDEN, 0, 0, 0, 0);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -718,7 +721,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
}
else {
printf("testing set file create time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file create time",
fnum2 = create_complex_file(cli, tctx,
BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, t, 0, 0, 0);,
@@ -729,7 +732,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
}
printf("testing set file access time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file access time",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, t, 0, 0);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -737,7 +740,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_LAST_ACCESS, 1);
printf("testing set file write time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file write time",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, t, 0);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -745,7 +748,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_LAST_WRITE, 1);
printf("testing set file change time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file change time",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, 0, t);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -754,7 +757,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
printf("testing write\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing write",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_write(cli->tree, fnum2, 1, &c, 10000, 1);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -762,7 +765,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
0, 1);
printf("testing truncate\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing truncate",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_ftruncate(cli->tree, fnum2, 10000);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c
index 26b862c33f..ec94637445 100644
--- a/source4/torture/raw/openbench.c
+++ b/source4/torture/raw/openbench.c
@@ -137,6 +137,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.fallback_to_anonymous = false;
io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
+ lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
/* kill off the remnants of the old connection */
talloc_free(state->tree);
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index fd8d292980..7e964b4d42 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -175,10 +175,11 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
struct smbcli_state **c)
{
NTSTATUS status;
-
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
options.use_level2_oplocks = false;
@@ -188,7 +189,7 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
torture_setting_string(tctx, "share", NULL),
NULL, cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;
diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c
index 6f0ba0d617..66ef2ae2dd 100644
--- a/source4/torture/raw/tconrate.c
+++ b/source4/torture/raw/tconrate.c
@@ -69,8 +69,10 @@ static int fork_tcon_client(struct torture_context *tctx,
struct timeval end;
struct timeval now;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
child = fork();
if (child == -1) {
@@ -100,7 +102,7 @@ static int fork_tcon_client(struct torture_context *tctx,
host, lp_smb_ports(tctx->lp_ctx), share,
NULL, cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c
index 77da32d572..ee0c05360f 100644
--- a/source4/torture/rpc/join.c
+++ b/source4/torture/rpc/join.c
@@ -19,6 +19,7 @@ bool torture_rpc_join(struct torture_context *torture)
struct smbcli_state *cli;
const char *host = torture_setting_string(torture, "host", NULL);
struct smbcli_options options;
+ struct smbcli_session_options session_options;
/* Join domain as a member server. */
tj = torture_join_domain(torture,
@@ -33,13 +34,14 @@ bool torture_rpc_join(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(tj, &cli, host,
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL,
machine_account,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
@@ -65,7 +67,7 @@ bool torture_rpc_join(struct torture_context *torture)
"IPC$", NULL,
machine_account,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 69bf33352b..af5ee4f6e1 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -2077,7 +2077,7 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p,
struct lsa_CreateTrustedDomainEx2 r;
struct lsa_TrustDomainInfoInfoEx trustinfo;
struct lsa_TrustDomainInfoAuthInfoInternal authinfo;
- struct trustAuthInAndOutBlob auth_struct;
+ struct trustDomainPasswords auth_struct;
DATA_BLOB auth_blob;
struct dom_sid *domsid[12];
struct policy_handle trustdom_handle[12];
@@ -2125,9 +2125,9 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p,
auth_struct.incoming.count = 0;
ndr_err = ndr_push_struct_blob(&auth_blob, mem_ctx, lp_iconv_convenience(tctx->lp_ctx), &auth_struct,
- (ndr_push_flags_fn_t)ndr_push_trustAuthInAndOutBlob);
+ (ndr_push_flags_fn_t)ndr_push_trustDomainPasswords);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- printf("ndr_push_struct_blob of trustAuthInAndOutBlob structure failed");
+ printf("ndr_push_struct_blob of trustDomainPasswords structure failed");
ret = false;
}
diff --git a/source4/torture/rpc/object_uuid.c b/source4/torture/rpc/object_uuid.c
new file mode 100644
index 0000000000..5a77bd1c29
--- /dev/null
+++ b/source4/torture/rpc/object_uuid.c
@@ -0,0 +1,87 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ test suite for behaviour of object uuids in rpc requests
+
+ Copyright (C) Stefan Metzmacher 2008
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+#include "librpc/gen_ndr/ndr_dssetup.h"
+#include "librpc/gen_ndr/ndr_dssetup_c.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
+#include "librpc/gen_ndr/ndr_lsa_c.h"
+#include "torture/rpc/rpc.h"
+
+/*
+ this tests the send object uuids in the dcerpc request
+*/
+
+static bool test_random_uuid(struct torture_context *torture)
+{
+ NTSTATUS status;
+ struct dcerpc_pipe *p1, *p2;
+ struct rpc_request *req;
+ struct GUID uuid;
+ struct dssetup_DsRoleGetPrimaryDomainInformation r1;
+ struct lsa_GetUserName r2;
+ struct lsa_StringPointer authority_name_p;
+
+ torture_comment(torture, "RPC-OBJECTUUID-RANDOM\n");
+
+ status = torture_rpc_connection(torture, &p1, &ndr_table_dssetup);
+ torture_assert_ntstatus_ok(torture, status, "opening dsetup pipe1");
+
+ status = torture_rpc_connection(torture, &p2, &ndr_table_lsarpc);
+ torture_assert_ntstatus_ok(torture, status, "opening lsa pipe1");
+
+ uuid = GUID_random();
+
+ r1.in.level = DS_ROLE_BASIC_INFORMATION;
+ req = dcerpc_ndr_request_send(p1, &uuid,
+ &ndr_table_dssetup,
+ NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION,
+ torture, &r1);
+ status = dcerpc_ndr_request_recv(req);
+ torture_assert_ntstatus_ok(torture, status, "DsRoleGetPrimaryDomainInformation failed");
+ torture_assert_werr_ok(torture, r1.out.result, "DsRoleGetPrimaryDomainInformation failed");
+
+ uuid = GUID_random();
+
+ r2.in.system_name = "\\";
+ r2.in.account_name = NULL;
+ r2.in.authority_name = &authority_name_p;
+ authority_name_p.string = NULL;
+
+ req = dcerpc_ndr_request_send(p2, &uuid,
+ &ndr_table_lsarpc,
+ NDR_LSA_GETUSERNAME,
+ torture, &r2);
+ status = dcerpc_ndr_request_recv(req);
+ torture_assert_ntstatus_ok(torture, status, "lsaClose failed");
+ torture_assert_ntstatus_ok(torture, r2.out.result, "lsaClose failed");
+
+ return true;
+}
+
+struct torture_suite *torture_rpc_object_uuid(TALLOC_CTX *mem_ctx)
+{
+ struct torture_suite *suite;
+ suite = torture_suite_create(mem_ctx, "OBJECTUUID");
+ torture_suite_add_simple_test(suite, "random-uuid", test_random_uuid);
+ return suite;
+}
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index 85f7bde16c..c35f93e3f9 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -387,6 +387,7 @@ NTSTATUS torture_rpc_init(void)
torture_suite_add_suite(suite, torture_rpc_atsvc(suite));
torture_suite_add_suite(suite, torture_rpc_wkssvc(suite));
torture_suite_add_suite(suite, torture_rpc_handles(suite));
+ torture_suite_add_suite(suite, torture_rpc_object_uuid(suite));
torture_suite_add_suite(suite, torture_rpc_winreg(suite));
torture_suite_add_simple_test(suite, "SPOOLSS", torture_rpc_spoolss);
torture_suite_add_suite(suite, torture_rpc_spoolss_notify(suite));
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 3bbf6cf223..260c1cc149 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -74,6 +74,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
struct cli_credentials *anon_creds;
struct smb_composite_sesssetup setup;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
mem_ctx = talloc_init("torture_bind_authcontext");
@@ -83,13 +84,14 @@ bool torture_bind_authcontext(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -142,7 +144,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
goto done;
}
- session2 = smbcli_session_init(cli->transport, mem_ctx, false);
+ session2 = smbcli_session_init(cli->transport, mem_ctx, false, session_options);
if (session2 == NULL) {
d_printf("smbcli_session_init failed\n");
goto done;
@@ -288,6 +290,7 @@ bool torture_bind_samba3(struct torture_context *torture)
bool ret = false;
struct smbcli_state *cli;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
mem_ctx = talloc_init("torture_bind_authcontext");
@@ -297,13 +300,14 @@ bool torture_bind_samba3(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1195,6 +1199,7 @@ bool torture_netlogon_samba3(struct torture_context *torture)
const char *wks_name;
int i;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
wks_name = torture_setting_string(torture, "wksname", NULL);
if (wks_name == NULL) {
@@ -1214,13 +1219,14 @@ bool torture_netlogon_samba3(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, anon_creds,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1299,15 +1305,17 @@ static bool test_join3(struct torture_context *tctx,
struct smbcli_state *cli;
struct cli_credentials *wks_creds;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli,
torture_setting_string(tctx, "host", NULL),
lp_smb_ports(tctx->lp_ctx),
"IPC$", NULL, smb_creds,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1670,19 +1678,21 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
struct cli_credentials *user_creds;
char *domain_name;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
if (!(mem_ctx = talloc_new(torture))) {
return false;
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
@@ -1709,7 +1719,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, anon_creds,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) anon smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
@@ -1762,7 +1772,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
struct smb_composite_sesssetup setup;
struct smbcli_tree *tree;
- session2 = smbcli_session_init(cli->transport, mem_ctx, false);
+ session2 = smbcli_session_init(cli->transport, mem_ctx, false, session_options);
if (session2 == NULL) {
d_printf("(%s) smbcli_session_init failed\n",
__location__);
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index 4fbffee41e..b7028e6609 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -53,7 +53,9 @@ struct samlogon_state {
const char *comment;
const char *account_name;
const char *account_domain;
+ const char *netbios_name;
const char *password;
+ const char *workgroup;
struct dcerpc_pipe *p;
int function_level;
uint32_t parameter_control;
@@ -593,7 +595,7 @@ static bool test_lmv2_ntlmv2_broken(struct samlogon_state *samlogon_state,
DATA_BLOB lmv2_response = data_blob(NULL, 0);
DATA_BLOB lmv2_session_key = data_blob(NULL, 0);
DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
- DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, TEST_MACHINE_NAME, lp_workgroup(global_loadparm));
+ DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, TEST_MACHINE_NAME, samlogon_state->workgroup);
uint8_t lm_session_key[8];
uint8_t user_session_key[16];
@@ -741,7 +743,7 @@ static bool test_lmv2_ntlm_broken(struct samlogon_state *samlogon_state,
DATA_BLOB lmv2_response = data_blob(NULL, 0);
DATA_BLOB lmv2_session_key = data_blob(NULL, 0);
DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
- DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, lp_netbios_name(global_loadparm), lp_workgroup(global_loadparm));
+ DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, samlogon_state->netbios_name, samlogon_state->workgroup);
DATA_BLOB ntlm_response = data_blob_talloc(samlogon_state->mem_ctx, NULL, 24);
DATA_BLOB ntlm_session_key = data_blob_talloc(samlogon_state->mem_ctx, NULL, 16);
@@ -1337,6 +1339,8 @@ static bool test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
samlogon_state.account_name = account_name;
samlogon_state.account_domain = account_domain;
samlogon_state.password = plain_pass;
+ samlogon_state.workgroup = lp_workgroup(tctx->lp_ctx);
+ samlogon_state.netbios_name = lp_netbios_name(tctx->lp_ctx);
samlogon_state.p = p;
samlogon_state.creds = creds;
samlogon_state.expected_error = expected_error;
diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c
index d7482ddcf1..3bddde2a97 100644
--- a/source4/torture/unix/unix_info2.c
+++ b/source4/torture/unix/unix_info2.c
@@ -56,15 +56,17 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli, host,
lp_smb_ports(tctx->lp_ctx),
share, NULL,
cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
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 39d0a12ab1..d742e23e82 100644
--- a/source4/torture/unix/whoami.c
+++ b/source4/torture/unix/whoami.c
@@ -77,14 +77,16 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx,
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli, host,
lp_smb_ports(tctx->lp_ctx),
share, NULL,
creds, lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
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 938e7d6c03..32e4453aca 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -475,8 +475,10 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
options.use_oplocks = torture_setting_bool(tctx, "use_oplocks", true);
options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", true);
@@ -486,7 +488,7 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
sharename, NULL,
cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- ev, &options);
+ ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;