1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

32 Commits

Author SHA1 Message Date
Stefan Metzmacher
64e68abdc9 s3:pylibsmb: make use of protocol independent cli_read_send/recv in py_cli_read()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:24 +01:00
Stefan Metzmacher
3c3b44004f s3:pylibsmb: make use of protocol independent cli_write_send/recv in py_cli_write()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:24 +01:00
Stefan Metzmacher
0af6b33544 s3:pylibsmb: make use of PYARG_BYTES_LEN in py_cli_write()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:24 +01:00
Stefan Metzmacher
60148c9ee1 s3:pylibsmb: make use of PyBytes_FromStringAndSize() in py_cli_read()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:23 +01:00
Tim Beale
aaf7aaa6e2 s3:pylibsmb: .get_oplock_break API is dependent on multi_threaded=True
The .get_oplock_break is dependent on the pthread code, which is only
used when creating a SMB connection with multi_threaded=True.

Add an explicit error to the .get_oplock_break() if someone tries to use
it in non-multithreaded mode.

Initializing self->oplock_waiter in non-multithreaded mode is similarly
redundant if the API can never be used.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:23 +01:00
Stefan Metzmacher
fdc62b03ca s3:pylibsmb: remember that a connection uses SMB1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:23 +01:00
Stefan Metzmacher
790dab571c s3:pylibsmb: add force_smb1=True in order to control forcing of SMB1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:23 +01:00
Stefan Metzmacher
247a71b63a s3:pylibsmb: add sign=True to require signing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:23 +01:00
Stefan Metzmacher
1bccbfcff7 s3:pylibsmb: only use poll_mt backend if multi_threaded=True is specified
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:23 +01:00
Stefan Metzmacher
59cb025e61 s3:pylibsmb: pass self to py_tevent_req_wait_exc()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-13 08:52:23 +01:00
Andreas Schneider
77b88fd059 s3:libsmb: Use #ifdef instead of #if for config.h definitions
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-11-28 23:19:23 +01:00
Noel Power
94fd3cfa79 python3 port for libsmb_samba_internal module
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-05 08:59:09 +02:00
Stefan Metzmacher
9c1ead502b CVE-2017-12150: s3:pylibsmb: make use of SMB_SIGNING_DEFAULT for 'samba.samba3.libsmb_samba_internal'
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2017-09-20 13:04:10 +02:00
Stefan Metzmacher
1e35c63f4e s3:pylibsmb: use CLI_FULL_CONNECTION_FORCE_SMB1 in py_cli_state_init()
For now we only support SMB1, as most of the cli_*_send() function don't
support SMB2, it's only plugged into the sync wrapper functions currently.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-22 13:07:40 +02:00
Stefan Metzmacher
3c67855c2b s3:libsmb: change cli_full_connection_send/recv into cli_full_connection_creds_send/recv
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-12-02 13:46:11 +01:00
Andrew Bartlett
0064f1d3a6 pylibsmb: Adjust to use of PY_SSIZE_T_CLEAN
This changes the type used for # arguments to PyArg_ParseTupleAndKeywords

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2016-01-07 23:33:10 +01:00
Jeremy Allison
69e24b4e8b s3: client : Add extra return parameter to all client open calls.
Add a return parameter of struct smb_create_returns *cr to
cli_ntcreate()
cli_ntcreate_recv()
cli_nttrans_create()
cli_nttrans_create_recv()

Always pass in NULL for now. This fixes the create
API to always fully return the data the server has
given back to us on the open file to the caller.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-09 23:10:07 +02:00
Stefan Metzmacher
a560d1d485 s3:pylibsmb: remove compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:43 +12:00
Volker Lendecke
237ec2fbac libsmbclient: Use async cli_full_connection in python connection setup
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 12 03:07:10 CEST 2013 on sn-devel-104
2013-04-12 03:07:10 +02:00
Volker Lendecke
f61ee7238b pylibsmb: Avoid a segfault if no credentials are passed to libsmb.Conn()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>

Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Tue Apr  9 18:30:06 CEST 2013 on sn-devel-104
2013-04-09 18:30:06 +02:00
Stefan Metzmacher
61f34e2d25 s3:pylibsmb: make sure we get tevent debug messages
Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Feb 28 14:34:24 CET 2013 on sn-devel-104
2013-02-28 14:34:22 +01:00
Volker Lendecke
13c28787ad s3-pylibsmb: Use Py_RETURN_NONE
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Sep 24 08:09:53 CEST 2012 on sn-devel-104
2012-09-24 08:09:53 +02:00
Volker Lendecke
9e6070b5fc s3-pylibsmb: Add get_oplock_break
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Sep 23 18:01:28 CEST 2012 on sn-devel-104
2012-09-23 18:01:28 +02:00
Volker Lendecke
ff6840815d s3-pylibsmb: Factor out py_tevent_cond_signal 2012-09-23 07:20:20 -07:00
Volker Lendecke
d0a0fb3292 s3-pylibsmb: Reduce the number of warnings 2012-09-23 07:20:20 -07:00
Volker Lendecke
982ddc4785 s3: Add "readdir" to pylibsmb 2012-09-23 07:20:20 -07:00
Christian Ambach
e0fdeda86c s3-pylibsmb: move py_tevent_req_wait_exc up in the file
this is needed to be able to use it in other functions and
spares the prototype

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
2012-09-23 07:20:20 -07:00
Volker Lendecke
947520521e s3-pylibsmb: Factor out py_tevent_cond_wait 2012-09-23 07:20:20 -07:00
Christian Ambach
b06dbfbba6 s3:libsmb fix a double free error
t refers to self->thread_state that is freed a few lines below

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Sep 17 22:04:13 CEST 2012 on sn-devel-104
2012-09-17 22:04:13 +02:00
Christian Ambach
57990cbcbb s3:libsmb fix a potential crash
Signed-off-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Sun Sep 16 22:31:38 CEST 2012 on sn-devel-104
2012-09-16 22:31:38 +02:00
Volker Lendecke
2fe08c886a s3: Fix memleaks in pylibsmb.c
Cut&Paste errors from the read&x routine

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:14:59 -07:00
Volker Lendecke
fbebd7530e s3-libsmb: Add a python wrapper
Please note that this is not finished and only for internal use.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 21:10:32 +02:00