s3:pylibsmb: Add .savefile() API to SMB py bindings
authorTim Beale <timbeale@catalyst.net.nz>
Mon, 10 Dec 2018 20:34:42 +0000 (09:34 +1300)
committerTim Beale <timbeale@samba.org>
Mon, 7 Jan 2019 00:23:08 +0000 (01:23 +0100)
commit0af78faf5c9424514ba5bc0baa18701c65c884e7
tree595e5af46cd21acd10020c00114ff81299f7514c
parente4d1d53597ac093d56ad9d528e2e580e626ab359
s3:pylibsmb: Add .savefile() API to SMB py bindings

This provides a simple API for writing a file's contents and makes the
s3 API consistent with the s4 API.

All the async APIs here support SMBv2 so we don't need to use the sync
APIs at all.

Note that we have the choice here of using either cli_write_send() or
cli_push_send(). I chose the latter, because that's what smbclient uses.
It also appears to handle writing a large file better (i.e. one that
exceeds the max write size of the underlying connection).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/smb.py
selftest/knownfail.d/smb [deleted file]
source3/libsmb/pylibsmb.c