summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-02-27 09:16:28 +0100
committerStefan Metzmacher <metze@samba.org>2012-02-27 12:51:34 +0100
commit07b1de98cd50f061f410b36043efcf13210caf6b (patch)
tree0567aecbd108065b992d50df16b7994d6ca46b10
parenta1ef9c761a6ccc16d6b1193ebcb95fa4493ac1ed (diff)
downloadsamba-07b1de98cd50f061f410b36043efcf13210caf6b.tar.gz
samba-07b1de98cd50f061f410b36043efcf13210caf6b.tar.bz2
samba-07b1de98cd50f061f410b36043efcf13210caf6b.zip
s4:librpc/dcerpc_smb2: make use of smb2cli_session_application_key()
metze
-rw-r--r--source4/librpc/rpc/dcerpc_smb2.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c
index ecc250412a..b822c44fda 100644
--- a/source4/librpc/rpc/dcerpc_smb2.c
+++ b/source4/librpc/rpc/dcerpc_smb2.c
@@ -34,6 +34,7 @@
struct smb2_private {
struct smb2_handle handle;
struct smb2_tree *tree;
+ DATA_BLOB session_key;
const char *server_name;
bool dead;
};
@@ -388,10 +389,12 @@ static NTSTATUS smb2_session_key(struct dcecli_connection *c, DATA_BLOB *session
{
struct smb2_private *smb = talloc_get_type(c->transport.private_data,
struct smb2_private);
- *session_key = smb->tree->session->session_key;
- if (session_key->data == NULL) {
+
+ if (smb->session_key.length == 0) {
return NT_STATUS_NO_USER_SESSION_KEY;
}
+
+ *session_key = smb->session_key;
return NT_STATUS_OK;
}
@@ -493,6 +496,14 @@ static void pipe_open_recv(struct smb2_request *req)
if (composite_nomem(smb->server_name, ctx)) return;
smb->dead = false;
+ ctx->status = smb2cli_session_application_key(tree->session->smbXcli,
+ smb, &smb->session_key);
+ if (NT_STATUS_EQUAL(ctx->status, NT_STATUS_NO_USER_SESSION_KEY)) {
+ smb->session_key = data_blob_null;
+ ctx->status = NT_STATUS_OK;
+ }
+ if (!composite_is_ok(ctx)) return;
+
c->transport.private_data = smb;
composite_done(ctx);