summaryrefslogtreecommitdiff
path: root/libcli/smb/tstream_smbXcli_np.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-11-27 18:19:38 +0100
committerJeremy Allison <jra@samba.org>2015-12-01 03:42:51 +0100
commit3bbd8d3614af641535ab0925303ad07c03c4e094 (patch)
tree854cceab02dd847cd1891e7c5577d0baa4878b70 /libcli/smb/tstream_smbXcli_np.c
parent0e8d33fb5ffd6fdb0e503c5ff59e3635bbf10041 (diff)
downloadsamba-3bbd8d3614af641535ab0925303ad07c03c4e094.tar.gz
libcli/smb: fix BUFFER_OVERFLOW handling in tstream_smbXcli_np
The special error is not NT_STATUS_BUFFER_TOO_SMALL, but STATUS_BUFFER_OVERFLOW. Tested using TSTREAM_SMBXCLI_NP_MAX_BUF_SIZE == 20 and running the following commands against a Windows 2012R2 server: bin/smbtorture ncacn_np:SERVER[] rpc.lsa-getuser bin/smbtorture ncacn_np:SERVER[smb2] rpc.lsa-getuser BUG: https://bugzilla.samba.org/show_bug.cgi?id=11623 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): Tue Dec 1 03:42:52 CET 2015 on sn-devel-104
Diffstat (limited to 'libcli/smb/tstream_smbXcli_np.c')
-rw-r--r--libcli/smb/tstream_smbXcli_np.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libcli/smb/tstream_smbXcli_np.c b/libcli/smb/tstream_smbXcli_np.c
index 9cd6302c8c7..af0863e50bb 100644
--- a/libcli/smb/tstream_smbXcli_np.c
+++ b/libcli/smb/tstream_smbXcli_np.c
@@ -976,7 +976,14 @@ static void tstream_smbXcli_np_readv_trans_done(struct tevent_req *subreq)
received = out_output_buffer.length;
}
TALLOC_FREE(subreq);
- if (NT_STATUS_EQUAL(status, NT_STATUS_BUFFER_TOO_SMALL)) {
+ if (NT_STATUS_EQUAL(status, STATUS_BUFFER_OVERFLOW)) {
+ /*
+ * STATUS_BUFFER_OVERFLOW means that there's
+ * more data to read when the named pipe is used
+ * in message mode (which is the case here).
+ *
+ * But we hide this from the caller.
+ */
status = NT_STATUS_OK;
}
if (!NT_STATUS_IS_OK(status)) {
@@ -1052,9 +1059,9 @@ static void tstream_smbXcli_np_readv_read_done(struct tevent_req *subreq)
* We can't TALLOC_FREE(subreq) as usual here, as rcvbuf still is a
* child of that.
*/
- if (NT_STATUS_EQUAL(status, NT_STATUS_BUFFER_TOO_SMALL)) {
+ if (NT_STATUS_EQUAL(status, STATUS_BUFFER_OVERFLOW)) {
/*
- * NT_STATUS_BUFFER_TOO_SMALL means that there's
+ * STATUS_BUFFER_OVERFLOW means that there's
* more data to read when the named pipe is used
* in message mode (which is the case here).
*