summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-05 15:00:23 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-05 20:55:38 +0200
commitf28b2ac65a58a99e694206522a853cfdc32a5e85 (patch)
tree1eb66ad5613a1d318d86025d835558fb9ae20785
parentf08e478d2fa9379d439dd10221607c33c083febf (diff)
downloadsamba-f28b2ac65a58a99e694206522a853cfdc32a5e85.tar.gz
samba-f28b2ac65a58a99e694206522a853cfdc32a5e85.tar.bz2
samba-f28b2ac65a58a99e694206522a853cfdc32a5e85.zip
s3:smb2_write: make use of SMBD_SMB2_* macros
metze
-rw-r--r--source3/smbd/smb2_write.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c
index c649befa87..03998caba1 100644
--- a/source3/smbd/smb2_write.c
+++ b/source3/smbd/smb2_write.c
@@ -40,7 +40,6 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
{
NTSTATUS status;
const uint8_t *inbody;
- int i = req->current_idx;
uint16_t in_data_offset;
uint32_t in_data_length;
DATA_BLOB in_data_buffer;
@@ -55,7 +54,7 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
if (!NT_STATUS_IS_OK(status)) {
return smbd_smb2_request_error(req, status);
}
- inbody = (const uint8_t *)req->in.vector[i+1].iov_base;
+ inbody = SMBD_SMB2_IN_BODY_PTR(req);
in_data_offset = SVAL(inbody, 0x02);
in_data_length = IVAL(inbody, 0x04);
@@ -64,11 +63,11 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
in_file_id_volatile = BVAL(inbody, 0x18);
in_flags = IVAL(inbody, 0x2C);
- if (in_data_offset != (SMB2_HDR_BODY + req->in.vector[i+1].iov_len)) {
+ if (in_data_offset != (SMB2_HDR_BODY + SMBD_SMB2_IN_BODY_LEN(req))) {
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}
- if (in_data_length > req->in.vector[i+2].iov_len) {
+ if (in_data_length > SMBD_SMB2_IN_DYN_LEN(req)) {
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}
@@ -80,7 +79,7 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}
- in_data_buffer.data = (uint8_t *)req->in.vector[i+2].iov_base;
+ in_data_buffer.data = SMBD_SMB2_IN_DYN_PTR(req);
in_data_buffer.length = in_data_length;
status = smbd_smb2_request_verify_creditcharge(req, in_data_length);