diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-05-16 16:50:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:07:25 -0500 |
commit | 410fb90322cf47780a9af4f5e38e57fcfa528471 (patch) | |
tree | 347b45882f2a0af7f1583ba007c076dcbffe0181 /source4/libcli/raw | |
parent | 12f377c638d118da58f2f2802baf28961a631f0f (diff) | |
download | samba-410fb90322cf47780a9af4f5e38e57fcfa528471.tar.gz samba-410fb90322cf47780a9af4f5e38e57fcfa528471.tar.bz2 samba-410fb90322cf47780a9af4f5e38e57fcfa528471.zip |
r15640: - NT IOCTL calls also have an 'in' data_blob
- fix the receive code of NT IOCTL's we only need the NTTRANS data payload
not the SMB payload here
metze
(This used to be commit 358d03143f0a78344c1af720e33ebe2619df09df)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/interfaces.h | 1 | ||||
-rw-r--r-- | source4/libcli/raw/rawioctl.c | 23 |
2 files changed, 17 insertions, 7 deletions
diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h index d9387cc6e2..e0696b45ec 100644 --- a/source4/libcli/raw/interfaces.h +++ b/source4/libcli/raw/interfaces.h @@ -1716,6 +1716,7 @@ union smb_ioctl { uint32_t function; BOOL fsctl; uint8_t filter; + DATA_BLOB blob; } in; struct { DATA_BLOB blob; diff --git a/source4/libcli/raw/rawioctl.c b/source4/libcli/raw/rawioctl.c index 49237fe9da..77c8c80158 100644 --- a/source4/libcli/raw/rawioctl.c +++ b/source4/libcli/raw/rawioctl.c @@ -86,7 +86,7 @@ static struct smbcli_request *smb_raw_ntioctl_send(struct smbcli_tree *tree, SCVAL(setup, 7, parms->ntioctl.in.filter); nt.in.function = NT_TRANSACT_IOCTL; nt.in.params = data_blob(NULL, 0); - nt.in.data = data_blob(NULL, 0); + nt.in.data = parms->ntioctl.in.blob; return smb_raw_nttrans_send(tree, &nt); } @@ -98,13 +98,22 @@ static NTSTATUS smb_raw_ntioctl_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, union smb_ioctl *parms) { - if (!smbcli_request_receive(req) || - smbcli_request_is_error(req)) { - return smbcli_request_destroy(req); - } + NTSTATUS status; + struct smb_nttrans nt; + TALLOC_CTX *tmp_mem; - parms->ntioctl.out.blob = smbcli_req_pull_blob(req, mem_ctx, req->in.data, -1); - return smbcli_request_destroy(req); + tmp_mem = talloc_new(mem_ctx); + NT_STATUS_HAVE_NO_MEMORY(tmp_mem); + + status = smb_raw_nttrans_recv(req, tmp_mem, &nt); + if (!NT_STATUS_IS_OK(status)) goto fail; + + parms->ntioctl.out.blob = nt.out.data; + talloc_steal(mem_ctx, parms->ntioctl.out.blob.data); + +fail: + talloc_free(tmp_mem); + return status; } |