diff options
author | Michael Adam <obnox@samba.org> | 2012-02-27 20:15:01 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-03-03 17:03:06 +0100 |
commit | b1a2ab1fa9222f794217e5917aea193ecf591e3e (patch) | |
tree | fdce2302f85cb00b9eea3378cc6816c48c8a3932 /source4 | |
parent | edeed1552d437b82e88288395d8e1db44ac2999a (diff) | |
download | samba-b1a2ab1fa9222f794217e5917aea193ecf591e3e.tar.gz samba-b1a2ab1fa9222f794217e5917aea193ecf591e3e.tar.xz samba-b1a2ab1fa9222f794217e5917aea193ecf591e3e.zip |
s4:libcli:smb2: add support durable handle request v2 blob in smb2_create_send
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libcli/smb2/create.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c index 438651f427f..4a5fca3205c 100644 --- a/source4/libcli/smb2/create.c +++ b/source4/libcli/smb2/create.c @@ -106,6 +106,34 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create } } + if (io->in.durable_open_v2) { + uint8_t data[32]; + uint32_t flags = 0; + DATA_BLOB guid_blob; + + SIVAL(data, 0, io->in.timeout); + if (io->in.persistent_open) { + flags = SMB2_DHANDLE_FLAG_PERSISTENT; + } + SIVAL(data, 4, flags); + SBVAL(data, 8, 0x0); /* reserved */ + 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); + + status = smb2_create_blob_add(req, &blobs, + SMB2_CREATE_TAG_DH2Q, + data_blob_const(data, 32)); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(req); + return NULL; + } + } + if (io->in.durable_handle) { uint8_t data[16]; smb2_push_handle(data, io->in.durable_handle); |