summaryrefslogtreecommitdiff
path: root/source4/libcli
AgeCommit message (Collapse)AuthorFilesLines
2019-03-01source4: Use wrapper for string to integer conversionSwen Schillig1-2/+3
In order to detect an value overflow error during the string to integer conversion with strtoul/strtoull, the errno variable must be set to zero before the execution and checked after the conversion is performed. This is achieved by using the wrapper function strtoul_err and strtoull_err. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-02-28s4:libcli: remember return code from maximum accessRalph Boehme2-2/+3
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13812 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2019-01-26s4:libcli: Remove (now unused) pysmb.c bindingsTim Beale2-757/+0
The s4 SMB client bindings don't support SMBv2, so we've made the decision to use the s3 SMB client bindings/library code instead. Everything in the Samba codebase now uses the s3 bindings, and we'll add a warning message to Samba v4.10 that the s4 bindings are deprecated. This patch removes the unused s4 bindings completely for the next (i.e. v4.11) release. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jan 26 04:05:25 CET 2019 on sn-devel-144
2019-01-17s4:pysmb: Add error log that the s4 bindings are deprecatedTim Beale1-0/+12
We plan to delete the s4 SMB Python bindings in the next Samba release after v4.10, but first give external consumers a heads-up, just in case they are currently using the s4 bindings. Note the auth_log tests still use the s4 bindings, but all user-facing tools should now be updated to use the s3 bindings. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-08libcli: Simplify smblsa_lookup_nameVolker Lendecke1-7/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-12s4:libcli: Fix error in smbcli_deltree()Tim Beale1-1/+1
Commit 094afe614b6282 fixed an uninitialized variable, which meant we tried to delete the file twice. The 2nd time fails, so the function returns an error, instead of success (even though the file is now gone). Note we want to be using the source3 SMB library code going forward. However, fixing this bug makes it easier to write tests against the (currently s4) SMB python bindings. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-02s4:libcli/smb2: reapply request endtimeRalph Boehme1-0/+17
tevent_req_finish() removed a possible request timeout, make sure to reinstall it. This happened when an interim SMB2 response was received. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13667 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-07-25s4: libcli/smb2: calculate correct credit charge for findsRalph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-07-24s4:libcli: add smb_connect_nego_{send,recv}()Stefan Metzmacher3-5/+246
This can be used to create a connection up to a negotiated smbXcli_conn. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: allow a fallback to NTLMSSP if SPNEGO is not supported locallyStefan Metzmacher1-5/+30
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: add fallback_to_anonymous to smb2_connect_send()Stefan Metzmacher1-0/+32
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: allow passing an already negotiated connection to smb2_connect_send()Stefan Metzmacher1-0/+21
It will just do the session setup and tree connect steps. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: split out smb2_connect_session_start()Stefan Metzmacher1-4/+12
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: add smb2_transport_raw_init()Stefan Metzmacher1-0/+35
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: allow passing an already negotiated connection to ↵Stefan Metzmacher3-10/+40
smb_composite_connect() It will just do the session setup and tree connect steps. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: use talloc_zero() for struct smb_composite_connect in fetchfile.cStefan Metzmacher1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: add smbcli_transport_raw_init()Stefan Metzmacher1-0/+44
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: split out smb_raw_negotiate_fill_transport()Stefan Metzmacher1-30/+44
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-12python: Allow forced signing via smb.SMB()David Mulder1-3/+7
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-28pysmb: add py_smb_unlink and testJoe Guo1-0/+24
Add unlink api to delete a file with a smb connection. Test added. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-05-12pysmb: Add some more documentation for conn.listGarming Sam1-1/+5
There are two options which are undocumented. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat May 12 04:57:29 CEST 2018 on sn-devel-144
2018-05-10samdb: Add transaction id controlGary Lockyer1-0/+1
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-04-24tevent: Fix callers of tevent_req_set_endtimeVolker Lendecke1-1/+0
tevent_req_set_endtime internally already calls tevent_req_nomem and thus sets the error status correctly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-13libdgram: Fix an error path memleakVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Apr 13 21:04:28 CEST 2018 on sn-devel-144
2018-04-13s4/libcli: python3 port for smb moduleNoel Power2-21/+40
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-03-13CVE-2018-1057: s4:dsdb/samdb: define ↵Ralph Boehme1-0/+1
DSDB_CONTROL_PASSWORD_ACL_VALIDATION_OID control Will be used to pass "user password change" vs "password reset" from the ACL to the password_hash module, ensuring both modules treat the request identical. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13272 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-02-27libdgram: Remove an unused parameterVolker Lendecke2-6/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-02-27libdgram: Remove an unused parameterVolker Lendecke2-4/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-02-27libsocket: Add "mem_ctx" to socket_create()Volker Lendecke2-5/+5
Every caller did a talloc_steal() after socket_create(). Just pass in the correct memory context. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-02-22util/rfc1738_unescape(): return end pointer or NULL on errorDouglas Bagnall1-4/+7
At present we don't detect errors, but when we do we'll return NULL. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-02-13libcli: Fix a cut&paste typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-01-30libcli: Remove finddcs_nbt.cVolker Lendecke1-311/+0
This completes commit 06c90cb6f55701effa4cbafaf189a4de8471949b Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jan 30 13:27:51 CET 2018 on sn-devel-144
2018-01-23libcli/resolve: Make functions staticVolker Lendecke1-9/+10
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): Tue Jan 23 06:36:36 CET 2018 on sn-devel-144
2018-01-23libcli/resolve: Make functions staticVolker Lendecke1-9/+10
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-23libcli/resolve: Fix typosVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-12-21s4:torture: add smb2.session.expire2 testStefan Metzmacher1-2/+5
This demonstrates the interaction of NT_STATUS_NETWORK_SESSION_EXPIRED and various SMB2 opcodes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13197 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-09-20Make sure smbtorture tests can run if someone has set their min protocol ↵Richard Sharpe1-0/+4
above NT1. This code is SMB1 only, and already modifies maxprotocol, so this change is appropriate. Signed-off-by: Richard Sharpe <richard.sharpe@primarydata.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-09-06python: Fix bad type in conversion of NTSTATUS.Lumir Balhar1-1/+1
More info: https://lists.samba.org/archive/samba-technical/2017-August/122574.html Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-06-17s4:libcli/smb_composite: make the additional gensec_update steps asyncStefan Metzmacher1-23/+128
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Jun 17 20:54:59 CEST 2017 on sn-devel-144
2017-06-17s4:libcli/smb_composite: add early returns to sesssetup.c:request_handler()Stefan Metzmacher1-11/+23
This makes it much clearer under which condutions the following code operates. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-17s4:libcli/smb_composite: make the first round to gensec asyncStefan Metzmacher1-36/+58
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-17s4:libcli/smb_composite: move gensec_update_ev() out of session_setup_spnego()Stefan Metzmacher1-16/+30
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-17s4:libcli/smb_composite: move session_setup_spnego_restart() to the callers ↵Stefan Metzmacher1-7/+21
of session_setup_spnego() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-17s4:libcli/smb_composite: split out session_setup_spnego_restart() from ↵Stefan Metzmacher1-19/+37
session_setup_spnego() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-17s4:libcli/smb_composite: move chosen_oid to state->chosen_oidStefan Metzmacher1-10/+20
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-17s4:libcli/smb_composite: simplify gensec_update_ev() handling in ↵Stefan Metzmacher1-13/+8
session_setup_spnego() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-05-22s4:libcli/ldap: just use gensec_update() in ldap_bind_sasl()Stefan Metzmacher1-2/+1
We're in a blocking/sync call, we should avoid using nested event loops for this. As far as I can see ldap_bind_sasl() is only called from command line tools, which are ok to block. Resolving this requires also resolving the general case in LDB, as that is the API this is used from. We would need ldb_connect_send() and ldb_connect_recv() at a start. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon May 22 01:12:23 CEST 2017 on sn-devel-144
2017-05-21s4:libcli/smb2: make smb2_session_setup_spnego_* completely asyncStefan Metzmacher1-93/+160
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-05-10s4-libcli: remove some dead prototypesGünther Deschner1-1/+0
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-03-29pysmb: Check for credentials using same method as pyrpcGary Lockyer1-1/+8
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>