diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-08-05 15:00:23 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-08-05 20:55:37 +0200 |
commit | 6e9a65ded3d0a67345d52c49108c3b7d21cf3a87 (patch) | |
tree | 14c6d6c23376a54c1edd1704f2227357b91fa555 /source3 | |
parent | 926379ae79a11bca78c6bf5a93b5aea1e3643094 (diff) | |
download | samba-6e9a65ded3d0a67345d52c49108c3b7d21cf3a87.tar.gz samba-6e9a65ded3d0a67345d52c49108c3b7d21cf3a87.tar.bz2 samba-6e9a65ded3d0a67345d52c49108c3b7d21cf3a87.zip |
s3:smb2_create: make use of SMBD_SMB2_* macros
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/smb2_create.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 7b5a26269b..c1cfa0cef3 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -101,7 +101,6 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req) { const uint8_t *inbody; const struct iovec *indyniov; - int i = smb2req->current_idx; uint8_t in_oplock_level; uint32_t in_impersonation_level; uint32_t in_desired_access; @@ -131,7 +130,7 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req) if (!NT_STATUS_IS_OK(status)) { return smbd_smb2_request_error(smb2req, status); } - inbody = (const uint8_t *)smb2req->in.vector[i+1].iov_base; + inbody = SMBD_SMB2_IN_BODY_PTR(smb2req); in_oplock_level = CVAL(inbody, 0x03); in_impersonation_level = IVAL(inbody, 0x04); @@ -153,7 +152,7 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req) * overlap */ - dyn_offset = SMB2_HDR_BODY + smb2req->in.vector[i+1].iov_len; + dyn_offset = SMB2_HDR_BODY + SMBD_SMB2_IN_BODY_LEN(smb2req); if (in_name_offset == 0 && in_name_length == 0) { /* This is ok */ @@ -164,7 +163,7 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req) name_offset = in_name_offset - dyn_offset; } - indyniov = &smb2req->in.vector[i+2]; + indyniov = SMBD_SMB2_IN_DYN_IOV(smb2req); if (name_offset > indyniov->iov_len) { return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER); @@ -258,7 +257,7 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req) static uint64_t get_mid_from_smb2req(struct smbd_smb2_request *smb2req) { - uint8_t *reqhdr = (uint8_t *)smb2req->out.vector[smb2req->current_idx].iov_base; + uint8_t *reqhdr = SMBD_SMB2_OUT_HDR_PTR(smb2req); return BVAL(reqhdr, SMB2_HDR_MESSAGE_ID); } |