summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-05-10 17:43:36 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-11 18:19:50 +0200
commit5e998b805ffb03c8cde1f81fd79e6763f061d1b6 (patch)
treeb1191c45f5a8077f80e41fae56c6e944d04d6b96 /source3
parent61546b5263d8363133e82c68ad823f9221120e9c (diff)
downloadsamba-5e998b805ffb03c8cde1f81fd79e6763f061d1b6.tar.gz
samba-5e998b805ffb03c8cde1f81fd79e6763f061d1b6.tar.bz2
samba-5e998b805ffb03c8cde1f81fd79e6763f061d1b6.zip
s3:smb2_ioctl: call SMB_VFS_FSCTL() as fallback for non SMB2 specific functions
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_ioctl.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c
index d537a8798c..a529fc5298 100644
--- a/source3/smbd/smb2_ioctl.c
+++ b/source3/smbd/smb2_ioctl.c
@@ -502,14 +502,43 @@ static struct tevent_req *smbd_smb2_ioctl_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- default:
- if (IS_IPC(smbreq->conn)) {
- tevent_req_nterror(req, NT_STATUS_FS_DRIVER_REQUIRED);
+ default: {
+ uint8_t *out_data = NULL;
+ uint32_t out_data_len = 0;
+ NTSTATUS status;
+
+ if (fsp == NULL) {
+ tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
return tevent_req_post(req, ev);
}
- tevent_req_nterror(req, NT_STATUS_INVALID_DEVICE_REQUEST);
+
+ status = SMB_VFS_FSCTL(fsp,
+ state,
+ in_ctl_code,
+ smbreq->flags2,
+ in_input.data,
+ in_input.length,
+ &out_data,
+ 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(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);
}
+ }
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return tevent_req_post(req, ev);