summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-07 20:35:51 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-08 10:21:50 +0200
commit3e227d8544a020d1aea24c38c9ca45a75d14c3f1 (patch)
tree607d31b7e117519742db8c5ebfd90a67a21781d3 /source3/torture
parentcdca1e0ac3c185856fbe2d061a30bfa8e71e4e1c (diff)
downloadsamba-3e227d8544a020d1aea24c38c9ca45a75d14c3f1.tar.gz
samba-3e227d8544a020d1aea24c38c9ca45a75d14c3f1.tar.bz2
samba-3e227d8544a020d1aea24c38c9ca45a75d14c3f1.zip
s3:libsmb: pass CLI_FULL_CONNECTION_* flags via cli_connect_nb()
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Sep 8 10:21:50 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/locktest.c16
-rw-r--r--source3/torture/masktest.c2
-rw-r--r--source3/torture/torture.c25
3 files changed, 25 insertions, 18 deletions
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index d6c544d8e8..da3b9a7cdf 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -169,6 +169,7 @@ static struct cli_state *connect_one(char *share, int snum)
fstring myname;
static int count;
NTSTATUS status;
+ int flags = 0;
fstrcpy(server,share+2);
share = strchr_m(server,'\\');
@@ -182,16 +183,21 @@ static struct cli_state *connect_one(char *share, int snum)
/* have to open a new connection */
- status = cli_connect_nb(server_n, NULL, 0, 0x20, myname, Undefined,
- &c);
+ if (use_kerberos) {
+ flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
+ }
+ if (use_oplocks) {
+ flags |= CLI_FULL_CONNECTION_OPLOCKS;
+ }
+
+ status = cli_connect_nb(server_n, NULL, 0, 0x20, myname,
+ Undefined, flags, &c);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Connection to %s failed. Error %s\n", server_n,
nt_errstr(status)));
return NULL;
}
- c->use_kerberos = use_kerberos;
-
status = cli_negprot(c);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("protocol negotiation failed: %s\n",
@@ -246,8 +252,6 @@ static struct cli_state *connect_one(char *share, int snum)
DEBUG(4,(" tconx ok\n"));
- c->use_oplocks = use_oplocks;
-
return c;
}
diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c
index 05f9c60806..6a4bb6e1d1 100644
--- a/source3/torture/masktest.c
+++ b/source3/torture/masktest.c
@@ -179,7 +179,7 @@ static struct cli_state *connect_one(char *share)
server_n = server;
- status = cli_connect_nb(server, NULL, 0, 0x20, "masktest", Undefined,
+ status = cli_connect_nb(server, NULL, 0, 0x20, "masktest", Undefined, 0,
&c);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Connection to %s failed. Error %s\n", server_n,
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index f07026d17a..495875b27a 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -181,19 +181,28 @@ static struct cli_state *open_nbt_connection(void)
{
struct cli_state *c;
NTSTATUS status;
+ int flags = 0;
+
+ if (use_oplocks) {
+ flags |= CLI_FULL_CONNECTION_OPLOCKS;
+ }
+
+ if (use_level_II_oplocks) {
+ flags |= CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS;
+ }
+
+ if (use_kerberos) {
+ flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
+ }
status = cli_connect_nb(host, NULL, port_to_use, 0x20, myname,
- signing_state, &c);
+ signing_state, flags, &c);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect with %s. Error %s\n", host, nt_errstr(status) );
return NULL;
}
- c->use_kerberos = use_kerberos;
-
cli_set_timeout(c, 120000); /* set a really long timeout (2 minutes) */
- if (use_oplocks) c->use_oplocks = True;
- if (use_level_II_oplocks) c->use_level_II_oplocks = True;
return c;
}
@@ -3545,18 +3554,12 @@ static bool run_oplock2(int dummy)
return False;
}
- cli1->use_oplocks = True;
- cli1->use_level_II_oplocks = True;
-
if (!torture_open_connection(&cli2, 1)) {
use_level_II_oplocks = False;
use_oplocks = saved_use_oplocks;
return False;
}
- cli2->use_oplocks = True;
- cli2->use_level_II_oplocks = True;
-
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
cli_sockopt(cli1, sockops);