summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-02-27 20:15:01 +0100
committerMichael Adam <obnox@samba.org>2012-03-03 17:03:07 +0100
commitdfbf55bb36e2f5cc798079b3fea2b34cd727e1b3 (patch)
tree9649b93afecad1c4b9d60e8c225122e7f2b2ee97
parentb1a2ab1fa9222f794217e5917aea193ecf591e3e (diff)
downloadsamba-dfbf55bb36e2f5cc798079b3fea2b34cd727e1b3.tar.gz
samba-dfbf55bb36e2f5cc798079b3fea2b34cd727e1b3.tar.xz
samba-dfbf55bb36e2f5cc798079b3fea2b34cd727e1b3.zip
s4:libcli:smb2: add support durable handle reconnect v2 blob in smb2_create_send
-rw-r--r--source4/libcli/smb2/create.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c
index 4a5fca3205c..8b7a4abb0ea 100644
--- a/source4/libcli/smb2/create.c
+++ b/source4/libcli/smb2/create.c
@@ -145,6 +145,33 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
}
}
+ if (io->in.durable_handle_v2) {
+ uint8_t data[36];
+ DATA_BLOB guid_blob;
+ uint32_t flags = 0;
+
+ smb2_push_handle(data, io->in.durable_handle_v2);
+ status = GUID_to_ndr_blob(&io->in.create_guid, req, /* TALLOC_CTX */
+ &guid_blob);
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(req);
+ return NULL;
+ }
+ memcpy(data+16, guid_blob.data, 16);
+ if (io->in.persistent_open) {
+ flags = SMB2_DHANDLE_FLAG_PERSISTENT;
+ }
+ SIVAL(data, 32, flags);
+
+ status = smb2_create_blob_add(req, &blobs,
+ SMB2_CREATE_TAG_DH2C,
+ data_blob_const(data, 36));
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(req);
+ return NULL;
+ }
+ }
+
if (io->in.timewarp) {
uint8_t data[8];
SBVAL(data, 0, io->in.timewarp);