summaryrefslogtreecommitdiff
path: root/source4/libcli
Commit message (Collapse)AuthorAgeFilesLines
* s4:libcli: remember return code from maximum accessRalph Boehme2019-03-112-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> (cherry picked from commit 9f4ee05295827c9a607e1f63694a17906f777176)
* s4:libcli/smb2: reapply request endtimeRalph Boehme2018-11-061-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> (cherry picked from commit a6de555c51ca34ef24ac4b4cb672cd748d3197a1)
* s4:libcli: add smb_connect_nego_{send,recv}()Stefan Metzmacher2018-08-133-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> (cherry picked from commit e4910f35eab008a41cfcac3d97b3647c721ac679)
* s4:libcli: allow a fallback to NTLMSSP if SPNEGO is not supported locallyStefan Metzmacher2018-08-131-5/+30
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> (cherry picked from commit 5188454bdce80f6e2bfc45deca18bd1b7289a7a6)
* s4:libcli: add fallback_to_anonymous to smb2_connect_send()Stefan Metzmacher2018-08-131-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> (cherry picked from commit ca000d8901e6acb8a7c59d26d4f75c9d92bafece)
* s4:libcli: allow passing an already negotiated connection to smb2_connect_send()Stefan Metzmacher2018-08-131-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> (cherry picked from commit f20e607c15b4c8ae56ade5d7e68d832542a2cd5e)
* s4:libcli: split out smb2_connect_session_start()Stefan Metzmacher2018-08-131-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> (cherry picked from commit 5ad5b81b6ef601596583b4ad7d6a14241fa99a71)
* s4:libcli: add smb2_transport_raw_init()Stefan Metzmacher2018-08-131-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> (cherry picked from commit ce2248c4b5aad2d00155a2e77b3e6340ce824979)
* s4:libcli: allow passing an already negotiated connection to ↵Stefan Metzmacher2018-08-133-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> (cherry picked from commit 2b68f9b8b0dd944fa89b9e0037886ddd4fb4e5f9)
* s4:libcli: use talloc_zero() for struct smb_composite_connect in fetchfile.cStefan Metzmacher2018-08-131-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> (cherry picked from commit 87d73397f9a9dee8fa0055a2ff08244b2c85e120)
* s4:libcli: add smbcli_transport_raw_init()Stefan Metzmacher2018-08-131-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> (cherry picked from commit b7e99c2571e31971a6d7f1898e7458c16dc1031e)
* s4:libcli: split out smb_raw_negotiate_fill_transport()Stefan Metzmacher2018-08-131-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> (cherry picked from commit 17b12a9b9a9dfd859679de77aa0c7ffbc782f1bc)
* 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>
* 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>
* pysmb: Extend py_smb_new to allow use_ntlmv2 and use_spnego to be set by callersAndrew Bartlett2017-03-291-13/+30
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: add max_credits arg to smbXcli_negprot_send()Ralph Boehme2017-03-033-5/+5
| | | | | | | | | | | | | | | This allows source4/torture code to set the option for tests by preparing a struct smbcli_options with max_credits set to some value and pass that to a torture_smb2_connection_ext(). This will be used in subsequent smbtorture test for SMB2 creditting. Behaviour of existing upper layers is unchanged, they simply pass the wanted max credits value to smbXcli_negprot_send() instead of retrofitting it with a call to smb2cli_conn_set_max_credits(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:libcli/raw: remove unused DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTHStefan Metzmacher2017-02-211-7/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12262 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* wscript: remove executable bits for all wscript* filesStefan Metzmacher2017-01-111-0/+0
| | | | | | | | | | These files should not be executable. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jan 11 20:21:01 CET 2017 on sn-devel-144
* pyerrors: Add PyErr_Set{WERROR,HRESULT,NTSTATUS}_and_string()Andrew Bartlett2016-11-041-0/+15
| | | | | | | | | This varient allows control of the text explaination string Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398
* python: create NTSTATUSError, HRESULTError and WERRORErrorAndrew Bartlett2016-11-041-3/+12
| | | | | | | | | | | The advantage of these over the previous use of just RuntimeError is that we can catch just the errors we want, without having to catch all possible RuntimeError cases and assume they decode to a tuple Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398
* wbclient: "ev" is no longer used in wbc_xids_to_sidsVolker Lendecke2016-09-282-4/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* wbclient: "ev" is no longer used in wbc_sids_to_xidsVolker Lendecke2016-09-282-4/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* pvfs_open win10 fix, need return SMB2_CREATE_TAG_QFIDouyang.xu2016-08-191-1/+3
| | | | | | | | | | Signed-off-by: kkhaike <kkhaike@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Fri Aug 19 09:35:15 CEST 2016 on sn-devel-144
* s4: libcli: Internal SMB1 pid is already stored as and uses 32-bits. Correct ↵Jeremy Allison2016-06-181-1/+1
| | | | | | | getpid() cast. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s4-libcli/raw: Fix compiler errors when building with --address-sanitizerAndrew Bartlett2016-06-161-2/+2
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4:libcli:resolve: fix O3 error unused result of writeMichael Adam2016-05-131-2/+3
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* typo: mplementation => implementationGarming Sam2016-05-064-4/+4
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4:libcli: fix 'Conditional jump or move' valgrind errorNoel Power2016-04-251-1/+4
| | | | | | | | | | | | | | | | | | | | | smbtorture test base.tcondev.tcondev causes the following valgrind trace ==23282== Conditional jump or move depends on uninitialised value(s) ==23282== at 0x9BE5632: smbcli_tconX (cliconnect.c:148) ==23282== by 0x41021C: tcon_devtest (base.c:91) ==23282== by 0x411A01: run_tcon_devtype_test (base.c:522) ==23282== by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856) ==23282== by 0x955368F: internal_torture_run_test (torture.c:442) ==23282== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==23282== by 0x2600A4: run_matching (smbtorture.c:110) ==23282== by 0x25FF66: run_matching (smbtorture.c:95) ==23282== by 0x2601C5: torture_run_named_tests (smbtorture.c:143) ==23282== by 0x261E44: main (smbtorture.c:665) ==23282== Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:libcli:smb2: Use constant time memcmp() to verify the signatureAndreas Schneider2016-04-191-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2016-2115: s4:libcli/raw: pass the minprotocol to smb_raw_negotiate*()Stefan Metzmacher2016-04-123-3/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2016-2115: s4:libcli/raw: limit maxprotocol to NT1 in smb_raw_negotiate*()Stefan Metzmacher2016-04-121-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2016-2115: s4:libcli/smb2: use the configured min_protocolStefan Metzmacher2016-04-121-1/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2016-2115: s4:libcli/raw: add smbcli_options.min_protocolStefan Metzmacher2016-04-121-0/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* CVE-2016-2113: s4:libcli/ldap: verify the server certificate and hostname if ↵Stefan Metzmacher2016-04-121-7/+4
| | | | | | | | | configured BUG: https://bugzilla.samba.org/show_bug.cgi?id=11752 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* CVE-2016-2113: s4:lib/tls: implement infrastructure to do peer verificationStefan Metzmacher2016-04-121-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11752 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* CVE-2016-2112: s4:libcli/ldap: auto upgrade to SIGN after STRONG_AUTH_REQUIREDStefan Metzmacher2016-04-121-0/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11644 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>