diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-05-19 14:15:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:08:08 -0500 |
commit | 82fd602cf0059e424e2246adca10ec942374c152 (patch) | |
tree | cbe697d1afa65edda4e6222eb69de33b227b1bca /source4/smb_server/smb | |
parent | 6dbd4ac331e4b4f5d87892cba1706244c2b55c0f (diff) | |
download | samba-82fd602cf0059e424e2246adca10ec942374c152.tar.gz samba-82fd602cf0059e424e2246adca10ec942374c152.tar.bz2 samba-82fd602cf0059e424e2246adca10ec942374c152.zip |
r15714: fix async handling of ntioctl calls and push the DATA_BLOB into the reply
metze
(This used to be commit 0ac9a49f42719914e63758ea4e53cab65dcdd317)
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r-- | source4/smb_server/smb/nttrans.c | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index d7c600aa52..c5b950ec5b 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -283,6 +283,28 @@ static NTSTATUS nttrans_rename(struct smbsrv_request *req, } /* + parse NTTRANS_IOCTL send + */ +static NTSTATUS nttrans_ioctl_send(struct nttrans_op *op) +{ + union smb_ioctl *info = talloc_get_type(op->op_info, union smb_ioctl); + NTSTATUS status; + + /* + * we pass 0 as data_count here, + * because we reuse the DATA_BLOB from the smb_ioctl + * struct + */ + status = nttrans_setup_reply(op, op->trans, 0, 0, 1); + NT_STATUS_NOT_OK_RETURN(status); + + op->trans->out.setup[0] = 0; + op->trans->out.data = info->ntioctl.out.blob; + + return NT_STATUS_OK; +} + +/* parse NTTRANS_IOCTL request */ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req, @@ -290,11 +312,6 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req, { struct smb_nttrans *trans = op->trans; union smb_ioctl *nt; - uint32_t function; - uint16_t fnum; - uint8_t filter; - BOOL fsctl; - NTSTATUS status; /* should have at least 4 setup words */ if (trans->in.setup_count != 4) { @@ -304,24 +321,17 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req, nt = talloc(op, union smb_ioctl); NT_STATUS_HAVE_NO_MEMORY(nt); - function = IVAL(trans->in.setup, 0); - fnum = SVAL(trans->in.setup, 4); - fsctl = CVAL(trans->in.setup, 6); - filter = CVAL(trans->in.setup, 7); - - nt->ntioctl.level = RAW_IOCTL_NTIOCTL; - nt->ntioctl.in.file.fnum = fnum; - nt->ntioctl.in.function = function; - nt->ntioctl.in.fsctl = fsctl; - nt->ntioctl.in.filter = filter; - nt->ntioctl.in.max_data = trans->in.max_data; - nt->ntioctl.in.blob = trans->in.data; - - status = nttrans_setup_reply(op, trans, 0, 0, 1); - NT_STATUS_NOT_OK_RETURN(status); + nt->ntioctl.level = RAW_IOCTL_NTIOCTL; + nt->ntioctl.in.function = IVAL(trans->in.setup, 0); + nt->ntioctl.in.file.fnum = SVAL(trans->in.setup, 4); + nt->ntioctl.in.fsctl = CVAL(trans->in.setup, 6); + nt->ntioctl.in.filter = CVAL(trans->in.setup, 7); + nt->ntioctl.in.max_data = trans->in.max_data; + nt->ntioctl.in.blob = trans->in.data; + + op->op_info = nt; + op->send_fn = nttrans_ioctl_send; - trans->out.setup[0] = 0; - return ntvfs_ioctl(req->ntvfs, nt); } |