summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-08-13 18:38:57 +0200
committerStefan Metzmacher <metze@samba.org>2013-08-15 09:07:07 +0200
commitccf7b3719121e03ed06d15b9af5373eecba3e828 (patch)
tree6e1bfe4cf7d5ec6e168683f7bc2b3719dedbdb79
parenta85d4511e6bc84938d60f090b44a5b1468ee4136 (diff)
downloadsamba-ccf7b3719121e03ed06d15b9af5373eecba3e828.tar.gz
samba-ccf7b3719121e03ed06d15b9af5373eecba3e828.tar.bz2
samba-ccf7b3719121e03ed06d15b9af5373eecba3e828.zip
s3:libsmb: add support for SMB2 in cli_writeall()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/libsmb/clireadwrite.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index d28c226037..adcd98bb0d 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -1066,7 +1066,13 @@ NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode,
if (ev == NULL) {
goto fail;
}
- req = cli_writeall_send(frame, ev, cli, fnum, mode, buf, offset, size);
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+ req = cli_smb2_writeall_send(frame, ev, cli, fnum, mode,
+ buf, offset, size);
+ } else {
+ req = cli_writeall_send(frame, ev, cli, fnum, mode,
+ buf, offset, size);
+ }
if (req == NULL) {
goto fail;
}
@@ -1074,7 +1080,11 @@ NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode,
status = map_nt_error_from_unix(errno);
goto fail;
}
- status = cli_writeall_recv(req, pwritten);
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+ status = cli_smb2_writeall_recv(req, pwritten);
+ } else {
+ status = cli_writeall_recv(req, pwritten);
+ }
fail:
TALLOC_FREE(frame);
return status;