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:40 +0200 |
commit | 47c67f2eac4eed26a8664627be7ebe29cf1420c1 (patch) | |
tree | a098e44d0ad85fc245144c21c649f08c6b1d0c24 /source3/smbd | |
parent | e281b9f798ffc36a94bfed6f5856661144b0ca3f (diff) | |
download | samba-47c67f2eac4eed26a8664627be7ebe29cf1420c1.tar.gz samba-47c67f2eac4eed26a8664627be7ebe29cf1420c1.tar.bz2 samba-47c67f2eac4eed26a8664627be7ebe29cf1420c1.zip |
s3:smb2_ioctl: make use of SMBD_SMB2_* macros
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/smb2_ioctl.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c index 3502d35fe3..c46520a5a7 100644 --- a/source3/smbd/smb2_ioctl.c +++ b/source3/smbd/smb2_ioctl.c @@ -45,7 +45,6 @@ NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req) { NTSTATUS status; const uint8_t *inbody; - int i = req->current_idx; uint32_t min_buffer_offset; uint32_t max_buffer_offset; uint32_t min_output_offset; @@ -74,7 +73,7 @@ NTSTATUS smbd_smb2_request_process_ioctl(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_ctl_code = IVAL(inbody, 0x04); in_file_id_persistent = BVAL(inbody, 0x08); @@ -87,8 +86,8 @@ NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req) in_max_output_length = IVAL(inbody, 0x2C); in_flags = IVAL(inbody, 0x30); - min_buffer_offset = SMB2_HDR_BODY + req->in.vector[i+1].iov_len; - max_buffer_offset = min_buffer_offset + req->in.vector[i+2].iov_len; + min_buffer_offset = SMB2_HDR_BODY + SMBD_SMB2_IN_BODY_LEN(req); + max_buffer_offset = min_buffer_offset + SMBD_SMB2_IN_DYN_LEN(req); min_output_offset = min_buffer_offset; /* @@ -114,7 +113,7 @@ NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req) allowed_length_in = max_buffer_offset - in_input_offset; tmp_ofs = in_input_offset - min_buffer_offset; - in_input_buffer.data = (uint8_t *)req->in.vector[i+2].iov_base; + in_input_buffer.data = SMBD_SMB2_IN_DYN_PTR(req); in_input_buffer.data += tmp_ofs; in_input_buffer.length = in_input_length; min_output_offset += tmp_ofs; @@ -151,7 +150,7 @@ NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req) } tmp_ofs = in_output_offset - min_buffer_offset; - in_output_buffer.data = (uint8_t *)req->in.vector[i+2].iov_base; + in_output_buffer.data = SMBD_SMB2_IN_DYN_PTR(req); in_output_buffer.data += tmp_ofs; in_output_buffer.length = in_output_length; } @@ -234,7 +233,6 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq) struct smbd_smb2_request *req = tevent_req_callback_data(subreq, struct smbd_smb2_request); const uint8_t *inbody; - int i = req->current_idx; DATA_BLOB outbody; DATA_BLOB outdyn; uint32_t in_ctl_code; @@ -279,7 +277,7 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq) out_input_offset = SMB2_HDR_BODY + 0x30; out_output_offset = SMB2_HDR_BODY + 0x30; - inbody = (const uint8_t *)req->in.vector[i+1].iov_base; + inbody = SMBD_SMB2_IN_BODY_PTR(req); in_ctl_code = IVAL(inbody, 0x04); in_file_id_persistent = BVAL(inbody, 0x08); |