summaryrefslogtreecommitdiffstats
path: root/source3/smbd/smb2_sesssetup.c
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:36 +0200
commit559742f45f5e220d2f69ea2929f7c04c42c35192 (patch)
treed433acd394143dab7564a6ce970f865ba0f78940 /source3/smbd/smb2_sesssetup.c
parent048c8d3db4feda04d7a4885ca83d5f5905760463 (diff)
downloadsamba-559742f45f5e220d2f69ea2929f7c04c42c35192.tar.gz
samba-559742f45f5e220d2f69ea2929f7c04c42c35192.tar.xz
samba-559742f45f5e220d2f69ea2929f7c04c42c35192.zip
s3:smb2_sesssetup: make use of SMBD_SMB2_* macros
metze
Diffstat (limited to 'source3/smbd/smb2_sesssetup.c')
-rw-r--r--source3/smbd/smb2_sesssetup.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 5355292967..474c04bc9d 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -49,7 +49,6 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *smb2req)
{
const uint8_t *inhdr;
const uint8_t *inbody;
- int i = smb2req->current_idx;
uint64_t in_session_id;
uint8_t in_flags;
uint8_t in_security_mode;
@@ -64,8 +63,8 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *smb2req)
if (!NT_STATUS_IS_OK(status)) {
return smbd_smb2_request_error(smb2req, status);
}
- inhdr = (const uint8_t *)smb2req->in.vector[i+0].iov_base;
- inbody = (const uint8_t *)smb2req->in.vector[i+1].iov_base;
+ inhdr = SMBD_SMB2_IN_HDR_PTR(smb2req);
+ inbody = SMBD_SMB2_IN_BODY_PTR(smb2req);
in_session_id = BVAL(inhdr, SMB2_HDR_SESSION_ID);
@@ -77,15 +76,15 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *smb2req)
in_security_length = SVAL(inbody, 0x0E);
in_previous_session_id = BVAL(inbody, 0x10);
- if (in_security_offset != (SMB2_HDR_BODY + smb2req->in.vector[i+1].iov_len)) {
+ if (in_security_offset != (SMB2_HDR_BODY + SMBD_SMB2_IN_BODY_LEN(smb2req))) {
return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER);
}
- if (in_security_length > smb2req->in.vector[i+2].iov_len) {
+ if (in_security_length > SMBD_SMB2_IN_DYN_LEN(smb2req)) {
return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER);
}
- in_security_buffer.data = (uint8_t *)smb2req->in.vector[i+2].iov_base;
+ in_security_buffer.data = SMBD_SMB2_IN_DYN_PTR(smb2req);
in_security_buffer.length = in_security_length;
subreq = smbd_smb2_session_setup_send(smb2req,
@@ -109,7 +108,6 @@ static void smbd_smb2_request_sesssetup_done(struct tevent_req *subreq)
struct smbd_smb2_request *smb2req =
tevent_req_callback_data(subreq,
struct smbd_smb2_request);
- int i = smb2req->current_idx;
uint8_t *outhdr;
DATA_BLOB outbody;
DATA_BLOB outdyn;
@@ -140,7 +138,7 @@ static void smbd_smb2_request_sesssetup_done(struct tevent_req *subreq)
out_security_offset = SMB2_HDR_BODY + 0x08;
- outhdr = (uint8_t *)smb2req->out.vector[i].iov_base;
+ outhdr = SMBD_SMB2_OUT_HDR_PTR(smb2req);
outbody = data_blob_talloc(smb2req->out.vector, NULL, 0x08);
if (outbody.data == NULL) {