summaryrefslogtreecommitdiff
path: root/source4/libcli
Commit message (Collapse)AuthorAgeFilesLines
* source4: Use wrapper for string to integer conversionSwen Schillig2019-03-011-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>
* s4:libcli: remember return code from maximum accessRalph Boehme2019-02-282-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>
* s4:libcli: Remove (now unused) pysmb.c bindingsTim Beale2019-01-262-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
* s4:pysmb: Add error log that the s4 bindings are deprecatedTim Beale2019-01-171-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>
* libcli: Simplify smblsa_lookup_nameVolker Lendecke2019-01-081-7/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:libcli: Fix error in smbcli_deltree()Tim Beale2018-12-121-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>
* s4:libcli/smb2: reapply request endtimeRalph Boehme2018-11-021-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>
* s4: libcli/smb2: calculate correct credit charge for findsRalph Boehme2018-07-251-0/+1
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:libcli: add smb_connect_nego_{send,recv}()Stefan Metzmacher2018-07-243-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>
* s4:libcli: allow a fallback to NTLMSSP if SPNEGO is not supported locallyStefan Metzmacher2018-07-241-5/+30
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s4:libcli: add fallback_to_anonymous to smb2_connect_send()Stefan Metzmacher2018-07-241-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>
* s4:libcli: allow passing an already negotiated connection to smb2_connect_send()Stefan Metzmacher2018-07-241-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>
* s4:libcli: split out smb2_connect_session_start()Stefan Metzmacher2018-07-241-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>
* s4:libcli: add smb2_transport_raw_init()Stefan Metzmacher2018-07-241-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>
* s4:libcli: allow passing an already negotiated connection to ↵Stefan Metzmacher2018-07-243-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>
* s4:libcli: use talloc_zero() for struct smb_composite_connect in fetchfile.cStefan Metzmacher2018-07-241-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>
* s4:libcli: add smbcli_transport_raw_init()Stefan Metzmacher2018-07-241-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>
* s4:libcli: split out smb_raw_negotiate_fill_transport()Stefan Metzmacher2018-07-241-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>
* python: Allow forced signing via smb.SMB()David Mulder2018-07-121-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>
* pysmb: add py_smb_unlink and testJoe Guo2018-06-281-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>
* pysmb: Add some more documentation for conn.listGarming Sam2018-05-121-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
* samdb: Add transaction id controlGary Lockyer2018-05-101-0/+1
| | | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tevent: Fix callers of tevent_req_set_endtimeVolker Lendecke2018-04-241-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>
* libdgram: Fix an error path memleakVolker Lendecke2018-04-131-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
* s4/libcli: python3 port for smb moduleNoel Power2018-04-132-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>
* CVE-2018-1057: s4:dsdb/samdb: define ↵Ralph Boehme2018-03-131-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>
* libdgram: Remove an unused parameterVolker Lendecke2018-02-272-6/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libdgram: Remove an unused parameterVolker Lendecke2018-02-272-4/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libsocket: Add "mem_ctx" to socket_create()Volker Lendecke2018-02-272-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>
* util/rfc1738_unescape(): return end pointer or NULL on errorDouglas Bagnall2018-02-221-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>
* libcli: Fix a cut&paste typoVolker Lendecke2018-02-131-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libcli: Remove finddcs_nbt.cVolker Lendecke2018-01-301-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
* libcli/resolve: Make functions staticVolker Lendecke2018-01-231-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
* libcli/resolve: Make functions staticVolker Lendecke2018-01-231-9/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/resolve: Fix typosVolker Lendecke2018-01-231-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture: add smb2.session.expire2 testStefan Metzmacher2017-12-211-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>
* Make sure smbtorture tests can run if someone has set their min protocol ↵Richard Sharpe2017-09-201-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>
* python: Fix bad type in conversion of NTSTATUS.Lumir Balhar2017-09-061-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>
* s4:libcli/smb_composite: make the additional gensec_update steps asyncStefan Metzmacher2017-06-171-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
* s4:libcli/smb_composite: add early returns to sesssetup.c:request_handler()Stefan Metzmacher2017-06-171-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>
* s4:libcli/smb_composite: make the first round to gensec asyncStefan Metzmacher2017-06-171-36/+58
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:libcli/smb_composite: move gensec_update_ev() out of session_setup_spnego()Stefan Metzmacher2017-06-171-16/+30
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:libcli/smb_composite: move session_setup_spnego_restart() to the callers ↵Stefan Metzmacher2017-06-171-7/+21
| | | | | | | of session_setup_spnego() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:libcli/smb_composite: split out session_setup_spnego_restart() from ↵Stefan Metzmacher2017-06-171-19/+37
| | | | | | | session_setup_spnego() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:libcli/smb_composite: move chosen_oid to state->chosen_oidStefan Metzmacher2017-06-171-10/+20
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:libcli/smb_composite: simplify gensec_update_ev() handling in ↵Stefan Metzmacher2017-06-171-13/+8
| | | | | | | session_setup_spnego() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:libcli/ldap: just use gensec_update() in ldap_bind_sasl()Stefan Metzmacher2017-05-221-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
* s4:libcli/smb2: make smb2_session_setup_spnego_* completely asyncStefan Metzmacher2017-05-211-93/+160
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-libcli: remove some dead prototypesGünther Deschner2017-05-101-1/+0
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* pysmb: Check for credentials using same method as pyrpcGary Lockyer2017-03-291-1/+8
| | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>