diff options
author | Michael Adam <obnox@samba.org> | 2013-10-04 12:39:57 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-10-05 15:56:11 +0200 |
commit | 9110c079f1aa504bc114d8c00a5a48f58dce5459 (patch) | |
tree | e47bc395ad4d74470c1d64661387a4baa31f1112 /source3 | |
parent | dd256792568d96c4a8dba5ea28cd3274ed1c040b (diff) | |
download | samba-9110c079f1aa504bc114d8c00a5a48f58dce5459.tar.gz samba-9110c079f1aa504bc114d8c00a5a48f58dce5459.tar.bz2 samba-9110c079f1aa504bc114d8c00a5a48f58dce5459.zip |
smbd:smb2: clarify and comment code treating dh2c blob check.
This makes the code that checks for extra create blobs in the
case of the dh2c blob look very similar to the corresponding
(slightly mode complex) code for the dhnc blob.
With this preparation it will be easier and more obvious how
to add proper treatment of the lease request blobs when leases
get implemented.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Oct 5 15:56:11 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/smb2_create.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 99a5b38ed6..140c81b309 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -515,16 +515,32 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, } if (dh2c) { + uint32_t num_blobs_allowed; + if (dh2c->data.length != 36) { tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return tevent_req_post(req, ev); } - if (in_context_blobs.num_blobs != 1) { - /* - * DH2C should be the only one. - * TODO: This is only true for the oplock case! - * For leases, lease request is required additionally! - */ + + /* + * According to MS-SMB2: 3.3.5.9.12, "Handling the + * SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context", + * we should fail the request with status + * OBJECT_NAME_NOT_FOUND if any other create blob has been + * provided. + * + * (Note that the cases of an additional dhnq, dhnc or dh2q + * blob which require a different error code, have been + * treated above.) + * + * TODO: + * This is only true for the oplock case: + * For leases, lease request is required additionally! + */ + + num_blobs_allowed = 1; + + if (in_context_blobs.num_blobs != num_blobs_allowed) { tevent_req_nterror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND); return tevent_req_post(req, ev); } |