summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/smb2/durable_open.c43
-rw-r--r--source4/torture/smb2/session.c5
-rw-r--r--source4/torture/smb2/util.c11
3 files changed, 46 insertions, 13 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c
index 77c23c19cd..f4822f6a11 100644
--- a/source4/torture/smb2/durable_open.c
+++ b/source4/torture/smb2/durable_open.c
@@ -497,6 +497,9 @@ static bool test_durable_open_reopen2a(struct torture_context *tctx,
struct smb2_create io1, io2;
uint64_t previous_session_id;
bool ret = true;
+ struct smbcli_options options;
+
+ options = tree->session->transport->options;
/* Choose a random name in case the state is left a little funky. */
snprintf(fname, 256, "durable_open_reopen2_%s.dat",
@@ -522,7 +525,9 @@ static bool test_durable_open_reopen2a(struct torture_context *tctx,
talloc_free(tree);
tree = NULL;
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &options, &tree))
+ {
torture_warning(tctx, "couldn't reconnect, bailing\n");
ret = false;
goto done;
@@ -816,6 +821,9 @@ static bool test_durable_open_delete_on_close2(struct torture_context *tctx,
uint8_t b = 0;
uint64_t previous_session_id;
uint64_t alloc_size_step;
+ struct smbcli_options options;
+
+ options = tree->session->transport->options;
/* Choose a random name in case the state is left a little funky. */
snprintf(fname, 256, "durable_open_delete_on_close2_%s.dat",
@@ -845,7 +853,9 @@ static bool test_durable_open_delete_on_close2(struct torture_context *tctx,
/* disconnect, leaving the durable handle in place */
TALLOC_FREE(tree);
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &options, &tree))
+ {
torture_warning(tctx, "could not reconnect, bailing\n");
ret = false;
goto done;
@@ -929,6 +939,9 @@ static bool test_durable_open_file_position(struct torture_context *tctx,
bool ret = true;
uint64_t pos;
uint64_t previous_session_id;
+ struct smbcli_options options;
+
+ options = tree->session->transport->options;
smb2_util_unlink(tree, fname);
@@ -978,7 +991,9 @@ static bool test_durable_open_file_position(struct torture_context *tctx,
tree = NULL;
/* do a session reconnect */
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &options, &tree))
+ {
torture_warning(tctx, "couldn't reconnect, bailing\n");
ret = false;
goto done;
@@ -1580,6 +1595,9 @@ static bool test_durable_open_alloc_size(struct torture_context *tctx,
uint64_t alloc_size_step;
uint64_t initial_alloc_size = 0x100;
const uint8_t *b = NULL;
+ struct smbcli_options options;
+
+ options = tree->session->transport->options;
/* Choose a random name in case the state is left a little funky. */
snprintf(fname, 256, "durable_open_alloc_size_%s.dat",
@@ -1614,7 +1632,9 @@ static bool test_durable_open_alloc_size(struct torture_context *tctx,
talloc_free(tree);
tree = NULL;
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &options, &tree))
+ {
torture_warning(tctx, "couldn't reconnect, bailing\n");
ret = false;
goto done;
@@ -1643,7 +1663,9 @@ static bool test_durable_open_alloc_size(struct torture_context *tctx,
talloc_free(tree);
tree = NULL;
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &options, &tree))
+ {
torture_warning(tctx, "couldn't reconnect, bailing\n");
ret = false;
goto done;
@@ -1671,7 +1693,9 @@ static bool test_durable_open_alloc_size(struct torture_context *tctx,
talloc_free(tree);
tree = NULL;
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &options, &tree))
+ {
torture_warning(tctx, "couldn't reconnect, bailing\n");
ret = false;
goto done;
@@ -1720,6 +1744,9 @@ static bool test_durable_open_read_only(struct torture_context *tctx,
uint64_t previous_session_id;
const uint8_t b = 0;
uint64_t alloc_size = 0;
+ struct smbcli_options options;
+
+ options = tree->session->transport->options;
/* Choose a random name in case the state is left a little funky. */
snprintf(fname, 256, "durable_open_initial_alloc_%s.dat",
@@ -1751,7 +1778,9 @@ static bool test_durable_open_read_only(struct torture_context *tctx,
talloc_free(tree);
tree = NULL;
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &options, &tree))
+ {
torture_warning(tctx, "couldn't reconnect, bailing\n");
ret = false;
goto done;
diff --git a/source4/torture/smb2/session.c b/source4/torture/smb2/session.c
index 3d7243380c..d076bb6d18 100644
--- a/source4/torture/smb2/session.c
+++ b/source4/torture/smb2/session.c
@@ -94,7 +94,10 @@ bool test_session_reconnect1(struct torture_context *tctx, struct smb2_tree *tre
/* disconnect, reconnect and then do durable reopen */
previous_session_id = smb2cli_session_current_id(tree->session->smbXcli);
- if (!torture_smb2_connection_ext(tctx, previous_session_id, &tree2)) {
+ if (!torture_smb2_connection_ext(tctx, previous_session_id,
+ &tree->session->transport->options,
+ &tree2))
+ {
torture_warning(tctx, "session reconnect failed\n");
ret = false;
goto done;
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index 4ffcfea1d1..f23708dd32 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -347,15 +347,13 @@ bool torture_smb2_session_setup(struct torture_context *tctx,
*/
bool torture_smb2_connection_ext(struct torture_context *tctx,
uint64_t previous_session_id,
+ const struct smbcli_options *options,
struct smb2_tree **tree)
{
NTSTATUS status;
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
struct cli_credentials *credentials = cmdline_credentials;
- struct smbcli_options options;
-
- lpcfg_smbcli_options(tctx->lp_ctx, &options);
status = smb2_connect_ext(tctx,
host,
@@ -366,7 +364,7 @@ bool torture_smb2_connection_ext(struct torture_context *tctx,
previous_session_id,
tree,
tctx->ev,
- &options,
+ options,
lpcfg_socket_options(tctx->lp_ctx),
lpcfg_gensec_settings(tctx, tctx->lp_ctx)
);
@@ -381,8 +379,11 @@ bool torture_smb2_connection_ext(struct torture_context *tctx,
bool torture_smb2_connection(struct torture_context *tctx, struct smb2_tree **tree)
{
bool ret;
+ struct smbcli_options options;
+
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
- ret = torture_smb2_connection_ext(tctx, 0, tree);
+ ret = torture_smb2_connection_ext(tctx, 0, &options, tree);
return ret;
}