summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-01 09:09:34 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-01 14:17:13 +0200
commit286e249737a40a575a9f13d8af4ef5e4e273c873 (patch)
tree7494ed7bec5a56432af52a9174590af4871baf39 /source4/librpc/rpc
parent2f4f2144f424d45d3077a7363ec733ff17999cd8 (diff)
downloadsamba-286e249737a40a575a9f13d8af4ef5e4e273c873.tar.gz
samba-286e249737a40a575a9f13d8af4ef5e4e273c873.tar.bz2
samba-286e249737a40a575a9f13d8af4ef5e4e273c873.zip
s4:librpc/dcerpc_smb: make use of smbXcli_session_application_key()
metze
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index f4f44577f4..e718725a74 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -32,6 +32,7 @@
struct smb_private {
uint16_t fnum;
struct smbcli_tree *tree;
+ DATA_BLOB session_key;
const char *server_name;
bool dead;
};
@@ -429,11 +430,13 @@ static NTSTATUS smb_session_key(struct dcecli_connection *c, DATA_BLOB *session_
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
if (smb == NULL) return NT_STATUS_CONNECTION_DISCONNECTED;
- if (smb->tree->session->user_session_key.data) {
- *session_key = smb->tree->session->user_session_key;
- return NT_STATUS_OK;
+
+ if (smb->session_key.length == 0) {
+ return NT_STATUS_NO_USER_SESSION_KEY;
}
- return NT_STATUS_NO_USER_SESSION_KEY;
+
+ *session_key = smb->session_key;
+ return NT_STATUS_OK;
}
struct pipe_open_smb_state {
@@ -555,6 +558,14 @@ static void pipe_open_recv(struct smbcli_request *req)
if (composite_nomem(smb->server_name, ctx)) return;
smb->dead = false;
+ ctx->status = smbXcli_session_application_key(state->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);