summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-07-23 22:11:19 +0200
committerStefan Metzmacher <metze@samba.org>2012-07-24 22:20:06 +0200
commit41538b17c5420b1e8e45d3e2987c77bc79c14de5 (patch)
tree7e81704fbb5f75ae4a3254efdf7e292a732d6d06 /source4
parentb9100a7ac443159716398aaadfab34af64d8858b (diff)
downloadsamba-41538b17c5420b1e8e45d3e2987c77bc79c14de5.tar.gz
samba-41538b17c5420b1e8e45d3e2987c77bc79c14de5.tar.bz2
samba-41538b17c5420b1e8e45d3e2987c77bc79c14de5.zip
s4:libcli/smb2: setup a smbXcli_tcon for each smb2_tree
metze
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/smb2/connect.c7
-rw-r--r--source4/libcli/smb2/smb2.h1
-rw-r--r--source4/libcli/smb2/tcon.c8
-rw-r--r--source4/torture/smb2/notify.c10
-rw-r--r--source4/torture/smb2/util.c8
5 files changed, 34 insertions, 0 deletions
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index 783d628f59..41f2d4bfa9 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -244,6 +244,13 @@ static void smb2_connect_tcon_done(struct smb2_request *smb2req)
state->tree->tid = state->tcon.out.tid;
state->tree->capabilities = state->tcon.out.capabilities;
+ smb2cli_tcon_set_values(state->tree->smbXcli,
+ state->tcon.out.tid,
+ state->tcon.out.share_type,
+ state->tcon.out.flags,
+ state->tcon.out.capabilities,
+ state->tcon.out.access_mask);
+
tevent_req_done(req);
}
diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h
index c4dc0001a0..569028e63c 100644
--- a/source4/libcli/smb2/smb2.h
+++ b/source4/libcli/smb2/smb2.h
@@ -108,6 +108,7 @@ struct smb2_tree {
struct smb2_session *session;
uint32_t tid;
uint32_t capabilities;
+ struct smbXcli_tcon *smbXcli;
};
/*
diff --git a/source4/libcli/smb2/tcon.c b/source4/libcli/smb2/tcon.c
index 3a0f246022..b13b5c1c51 100644
--- a/source4/libcli/smb2/tcon.c
+++ b/source4/libcli/smb2/tcon.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "../libcli/smb/smbXcli_base.h"
/*
initialise a smb2_session structure
@@ -40,6 +41,13 @@ struct smb2_tree *smb2_tree_init(struct smb2_session *session,
} else {
tree->session = talloc_reference(tree, session);
}
+
+ tree->smbXcli = smbXcli_tcon_create(tree);
+ if (tree->smbXcli == NULL) {
+ talloc_free(tree);
+ return NULL;
+ }
+
return tree;
}
diff --git a/source4/torture/smb2/notify.c b/source4/torture/smb2/notify.c
index 7a4e5622d2..c374ae781e 100644
--- a/source4/torture/smb2/notify.c
+++ b/source4/torture/smb2/notify.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "../libcli/smb/smbXcli_base.h"
#include "torture/torture.h"
#include "torture/smb2/proto.h"
@@ -1820,6 +1821,15 @@ static struct smb2_tree *secondary_tcon(struct smb2_tree *tree,
}
tree1->tid = tcon.smb2.out.tid;
+ tree1->capabilities = tcon.smb2.out.capabilities;
+
+ smb2cli_tcon_set_values(tree1->smbXcli,
+ tcon.smb2.out.tid,
+ tcon.smb2.out.share_type,
+ tcon.smb2.out.flags,
+ tcon.smb2.out.capabilities,
+ tcon.smb2.out.access_mask);
+
torture_comment(tctx,"tid1=%d tid2=%d\n", tree->tid, tree1->tid);
return tree1;
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index e966b9cbe4..0e5f1e1f07 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -23,6 +23,7 @@
#include "libcli/security/security_descriptor.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "../libcli/smb/smbXcli_base.h"
#include "lib/cmdline/popt_common.h"
#include "system/time.h"
#include "librpc/gen_ndr/ndr_security.h"
@@ -297,6 +298,13 @@ bool torture_smb2_tree_connect(struct torture_context *tctx,
tree->tid = tcon.out.tid;
tree->capabilities = tcon.out.capabilities;
+ smb2cli_tcon_set_values(tree->smbXcli,
+ tcon.out.tid,
+ tcon.out.share_type,
+ tcon.out.flags,
+ tcon.out.capabilities,
+ tcon.out.access_mask);
+
*_tree = tree;
return true;