diff options
author | Volker Lendecke <vl@samba.org> | 2013-06-22 18:43:00 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-08-12 17:25:54 +1200 |
commit | adc3ac9ecdd7000c629b74d6477bbd59124cc7d2 (patch) | |
tree | 14edb2d1eb12e47ad5291632865c565c7de97203 | |
parent | 8420d1c8ee031bb48d3bd845515355251a799633 (diff) | |
download | samba-adc3ac9ecdd7000c629b74d6477bbd59124cc7d2.tar.gz samba-adc3ac9ecdd7000c629b74d6477bbd59124cc7d2.tar.bz2 samba-adc3ac9ecdd7000c629b74d6477bbd59124cc7d2.zip |
smbd: Fix CID 1035550 Structurally dead code
Just a single ctl_code from my point of view is okay with an if(). All
other cases are handled behind the VFS these days.
The dead code was the last tevent_req_nterror and post routines.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source3/smbd/smb2_ioctl_named_pipe.c | 67 |
1 files changed, 29 insertions, 38 deletions
diff --git a/source3/smbd/smb2_ioctl_named_pipe.c b/source3/smbd/smb2_ioctl_named_pipe.c index 601e1c31e3..13c4982d64 100644 --- a/source3/smbd/smb2_ioctl_named_pipe.c +++ b/source3/smbd/smb2_ioctl_named_pipe.c @@ -35,11 +35,13 @@ struct tevent_req *smb2_ioctl_named_pipe(uint32_t ctl_code, struct tevent_req *req, struct smbd_smb2_ioctl_state *state) { - struct tevent_req *subreq; + NTSTATUS status; + uint8_t *out_data = NULL; + uint32_t out_data_len = 0; + + if (ctl_code == FSCTL_PIPE_TRANSCEIVE) { + struct tevent_req *subreq; - switch (ctl_code) { - case FSCTL_PIPE_TRANSCEIVE: - { if (!IS_IPC(state->smbreq->conn)) { tevent_req_nterror(req, NT_STATUS_NOT_SUPPORTED); return tevent_req_post(req, ev); @@ -69,47 +71,36 @@ struct tevent_req *smb2_ioctl_named_pipe(uint32_t ctl_code, smbd_smb2_ioctl_pipe_write_done, req); return req; - break; } - default: { - NTSTATUS status; - uint8_t *out_data = NULL; - uint32_t out_data_len = 0; - if (state->fsp == NULL) { - status = NT_STATUS_NOT_SUPPORTED; - } else { - status = SMB_VFS_FSCTL(state->fsp, - state, - ctl_code, - state->smbreq->flags2, - state->in_input.data, - state->in_input.length, - &out_data, - state->in_max_output, - &out_data_len); - state->out_output = data_blob_const(out_data, out_data_len); - if (NT_STATUS_IS_OK(status)) { - tevent_req_done(req); - return tevent_req_post(req, ev); - } + if (state->fsp == NULL) { + status = NT_STATUS_NOT_SUPPORTED; + } else { + status = SMB_VFS_FSCTL(state->fsp, + state, + ctl_code, + state->smbreq->flags2, + state->in_input.data, + state->in_input.length, + &out_data, + state->in_max_output, + &out_data_len); + state->out_output = data_blob_const(out_data, out_data_len); + if (NT_STATUS_IS_OK(status)) { + tevent_req_done(req); + return tevent_req_post(req, ev); } + } - if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { - if (IS_IPC(state->smbreq->conn)) { - status = NT_STATUS_FS_DRIVER_REQUIRED; - } else { - status = NT_STATUS_INVALID_DEVICE_REQUEST; - } + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + if (IS_IPC(state->smbreq->conn)) { + status = NT_STATUS_FS_DRIVER_REQUIRED; + } else { + status = NT_STATUS_INVALID_DEVICE_REQUEST; } - - tevent_req_nterror(req, status); - return tevent_req_post(req, ev); - break; - } } - tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR); + tevent_req_nterror(req, status); return tevent_req_post(req, ev); } |