summaryrefslogtreecommitdiff
path: root/libcli/smb/smb2cli_ioctl.c
AgeCommit message (Collapse)AuthorFilesLines
2015-12-01libcli/smb: make sure we have a body size of 0x31 before dereferencing an ↵Stefan Metzmacher1-37/+47
ioctl response Found by valgrind, reported by Noel Power <nopower@suse.com>: ==7913== Invalid read of size 1 ==7913== at 0xC4F23EE: smb2cli_ioctl_done (smb2cli_ioctl.c:245) ==7913== by 0x747A744: _tevent_req_notify_callback (tevent_req.c:112) ==7913== by 0x747A817: tevent_req_finish (tevent_req.c:149) ==7913== by 0x747A93C: tevent_req_trigger (tevent_req.c:206) ==7913== by 0x7479B2B: tevent_common_loop_immediate (tevent_immediate.c:135) ==7913== by 0xA9CB4BE: run_events_poll (events.c:192) ==7913== by 0xA9CBB32: s3_event_loop_once (events.c:303) ==7913== by 0x7478C72: _tevent_loop_once (tevent.c:533) ==7913== by 0x747AACD: tevent_req_poll (tevent_req.c:256) ==7913== by 0x505315D: tevent_req_poll_ntstatus (tevent_ntstatus.c:109) ==7913== by 0xA7201F2: cli_tree_connect (cliconnect.c:2764) ==7913== by 0x165FF7: cm_prepare_connection (winbindd_cm.c:1276) ==7913== Address 0x16ce24ec is 764 bytes inside a block of size 813 alloc'd ==7913== at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==7913== by 0x768A0C1: __talloc_with_prefix (talloc.c:668) ==7913== by 0x768A27E: _talloc_pool (talloc.c:721) ==7913== by 0x768A41E: _talloc_pooled_object (talloc.c:790) ==7913== by 0x747A594: _tevent_req_create (tevent_req.c:66) ==7913== by 0xCF6E2FA: read_packet_send (async_sock.c:414) ==7913== by 0xCF6EB54: read_smb_send (read_smb.c:54) ==7913== by 0xC4DA146: smbXcli_conn_receive_next (smbXcli_base.c:1027) ==7913== by 0xC4DA02D: smbXcli_req_set_pending (smbXcli_base.c:978) ==7913== by 0xC4DF776: smb2cli_req_compound_submit (smbXcli_base.c:3166) ==7913== by 0xC4DFC1D: smb2cli_req_send (smbXcli_base.c:3268) ==7913== by 0xC4F2210: smb2cli_ioctl_send (smb2cli_ioctl.c:149) ==7913== BUG: https://bugzilla.samba.org/show_bug.cgi?id=11622 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-29s3: libsmbclient: Add server-side copy supportRoss Lagerwall1-4/+47
Introduce a new operation, splice, which copies data from one SMBCFILE to another. Implement this operation using FSCTL_SRV_COPYCHUNK_WRITE for SMB2+ protocols and using read+write for older protocols. Since the operation may be long running, it takes a callback which gets called periodically to indicate progress to the application and given an opportunity to stop it. Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-30libcli/smb: list NT_STATUS_FILE_CLOSED as expected ioctl response.Stefan Metzmacher1-1/+11
Some IOCTL requests change the behavior with new protocol versions. E.g. FSCTL_VALIDATE_NEGOTIATE_INFO resulted in NT_STATUS_FILE_CLOSED for old servers. As SMB2 signing might be skipped for responses with NT_STATUS_FILE_CLOSED we need to list it explicitly in the expected return values. This way we'll get NT_STATUS_ACCESS_DENIED, if the server doesn't sign the response to a signed requests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-31libcli/smb: fix smb2cli_ioctl*() against Windows 2008.Stefan Metzmacher1-4/+29
The subsections of [MS-SMB2] "3.2.5.14 Receiving an SMB2 IOCTL Response" say the client should ignore the InputOffset/InputCount. We do that only if we ask for max_input_length = 0. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10232 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 31 01:16:10 CET 2013 on sn-devel-104
2013-08-15libcli/smb: pass max_dyn_len to smb2cli_req_send()Stefan Metzmacher1-1/+12
This way we can calculate the correct credit charge for requests with large output buffers. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-19libcli/smb: make use of samba_tevent_context_init()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-12-21libcli: Fix smb2cli_ioctl_send() if clause.Andreas Schneider1-1/+1
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-09-29libcli/smb: use an explicit TALLOC_FREE(subreq) in smb2cli_*Stefan Metzmacher1-0/+1
metze
2012-07-25libcli/smb: there's no PID field in the SMB2/3 header anymoreStefan Metzmacher1-1/+0
It's a reserved field... metze
2012-07-25libcli/smb: pass smbXcli_tcon to smb2cli_req_create/send()Stefan Metzmacher1-6/+1
metze
2012-07-24libcli/smb: pass smbXcli_tcon to smb2cli_ioctl*()Stefan Metzmacher1-3/+8
metze
2012-05-29s3:smb2cli_ioctl: fix requests without output_buffer.length > 0 against windowsStefan Metzmacher1-1/+1
This fixes DCERPC over SMB2 against windows servers. metze
2012-05-15libcli/smb: move smb2cli_ioctl.c from source3 to the toplevelBjörn Baumbach1-0/+335
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue May 15 20:17:01 CEST 2012 on sn-devel-104