summaryrefslogtreecommitdiff
path: root/libcli
Commit message (Collapse)AuthorAgeFilesLines
* libcli:smb: Add smb_encryption_setting_translate()Andreas Schneider2020-08-193-0/+40
| | | | | | | | Add encryption enum and function to avoid confusion when reading the code. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli:smb: Add smb_signing_setting_translate()Andreas Schneider2020-08-194-0/+96
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* param: Create and use enum_smb_encryption_valsAndreas Schneider2020-08-191-0/+9
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli:smb2: Use talloc NULL context if we don't have a stackframeAndreas Schneider2020-08-191-4/+26
| | | | | | | | | | | If we execute this code from python we don't have a talloc stackframe around and segfault with talloc_tos(). To fix the crash we use the NULL context as we take care for freeing the memory as soon as possible. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli:smb2: Do not leak ptext on errorAndreas Schneider2020-08-191-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/ldap: Fix CID 1462695 Resource leakVolker Lendecke2020-08-061-0/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/ldap: Fix CID 1462696 Resource leakVolker Lendecke2020-08-061-0/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/ldap: Fix CID 1465278 Resource leakVolker Lendecke2020-08-061-0/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/s4: Cleanup. Move TALLOC_CTX * parameter to be first in ↵Jeremy Allison2020-08-042-6/+8
| | | | | | | | | resolve_lmhosts_file_as_sockaddr() to match modern conventions. No logic changes. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Isaac Boukris <iboukris@samba.org>
* lib: relicense smb_strtoul(l) under LGPLv3Ralph Boehme2020-08-031-0/+1
| | | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 3 22:21:04 UTC 2020 on sn-devel-184
* libcli/ldap: Fix decoding struct ldap_ExtendedResponseVolker Lendecke2020-07-091-2/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/ldap: Test decoding an exop responseVolker Lendecke2020-07-092-0/+43
| | | | | | | | ldap-starttls-response.dat is a reply to a starttls extended operation. Right now ldap_decode() does not handle this correctly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: define FSCTL_SMBTORTURE_FORCE_UNACKED_TIMEOUTStefan Metzmacher2020-07-081-0/+8
| | | | | | | | | | This will be used by smbtorture in order to simulate channel failures without relying on iptables. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* CVE-2020-14303: s4 nbt: fix busy loop on empty UDP packetGary Lockyer2020-07-021-1/+16
| | | | | | | | | | | | An empty UDP packet put the nbt server into a busy loop that consumes 100% of a cpu. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14417 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Karolin Seeger <kseeger@samba.org> Autobuild-Date(master): Thu Jul 2 10:26:24 UTC 2020 on sn-devel-184
* libcli ldap tests: remove use of zero length arrayGary Lockyer2020-06-231-1/+1
| | | | | | | | | | | | | | libcli/ldap/tests/ldap_message_test.c defines a zero length array (uint8_t buf[0]), which is a GCC extension and breaks the build with some strict compilers like xlc. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14387 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jun 23 02:15:35 UTC 2020 on sn-devel-184
* libcli: Remove define STATUS_EA_LIST_INCONSISTENTChristof Schmitt2020-06-222-2/+0
| | | | | | | | | | | The auto-generated define NT_STATUS_EA_LIST_INCONSISTENT is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Jun 22 13:30:51 UTC 2020 on sn-devel-184
* libcli: Remove define STATUS_STOPPED_ON_SYMLINKChristof Schmitt2020-06-222-2/+0
| | | | | | | The auto-generated define NT_STATUS_STOPPED_ON_SYMLINK is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Remove define for STATUS_PENDINGChristof Schmitt2020-06-221-1/+0
| | | | | | The auto-generated define NT_STATUS_PENDING is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Use NT_STATUS_PENDING instead of STATUS_PENDINGChristof Schmitt2020-06-221-3/+3
| | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Remove define for STATUS_NOTIFY_ENUM_DIRChristof Schmitt2020-06-222-2/+0
| | | | | | The auto-generated define NT_STATUS_NOTIFY_ENUM_DIR is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Remove define for STATUS_NOTIFY_CLEANUPChristof Schmitt2020-06-222-2/+0
| | | | | | The auto-generated NT_STATUS_NOTIFY_CLEANUP is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Remove define for STATUS_INVALID_EA_FLAGChristof Schmitt2020-06-222-2/+0
| | | | | | The auto-generated define NT_STATUS_INVALID_EA_FLAG is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Remove define STATUS_NO_MORE_EASChristof Schmitt2020-06-222-2/+0
| | | | | | The auto-generated define NT_STATUS_NO_MORE_EAS is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Remove define for ERROR_INVALID_DATATYPEChristof Schmitt2020-06-221-1/+0
| | | | | | The auto-generated define WERR_INVALID_DATATYPE is still available. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* libcli: Add tevent_req_received() calls to smb2cli_create_recv()Volker Lendecke2020-06-151-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Move IO_REPARSE_TAG definitions to smb_constants.hVolker Lendecke2020-06-151-0/+16
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Slightly simplify smb2cli_req_recv() with an early returnVolker Lendecke2020-06-151-6/+1
| | | | | | | One if-condition less Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: simplify an if conditionRalph Boehme2020-05-301-1/+4
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* add some missing FSCTL definesBjörn Jacke2020-05-191-0/+8
| | | | | | | | | | | | | | | | | | | | as dodumented in https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/a64e55aa-1152-48e4-8206-edd96444e7f7 FSCTL_SET_OBJECT_ID_EXTENDED FSCTL_READ_FILE_USN_DATA FSCTL_WRITE_USN_CLOSE_RECORD FSCTL_QUERY_ON_DISK_VOLUME_INFO FSCTL_QUERY_SPARING_INFO FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX FSCTL_STORAGE_QOS_CONTROL Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Björn Jacke <bjacke@samba.org> Autobuild-Date(master): Tue May 19 15:57:08 UTC 2020 on sn-devel-184
* Fix clang 9 missing-field-initializer warningsGary Lockyer2020-05-082-2/+2
| | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2020-10704 libcli ldap: Check search request lengths.Gary Lockyer2020-05-041-0/+4
| | | | | | | | | | | | | | | | Check the search request lengths against the limits passed to ldap_decode. Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Mon May 4 04:40:10 UTC 2020 on sn-devel-184
* CVE-2020-10704: libcli ldap_message: Add search size limits to ldap_decodeGary Lockyer2020-05-044-7/+41
| | | | | | | | | | | | | | | | Add search request size limits to ldap_decode calls. The ldap server uses the smb.conf variable "ldap max search request size" which defaults to 250Kb. For cldap the limit is hard coded as 4096. Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2020-10704: libcli ldap: test recursion depth in ldap_decode_filter_treeGary Lockyer2020-05-044-0/+286
| | | | | | | | | | | | | | Add tests to check that ASN.1 ldap requests with deeply nested elements are rejected. Previously there was no check on the on the depth of nesting and excessive nesting could cause a stack overflow. Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2020-10704: lib util asn1: Add ASN.1 max tree depthGary Lockyer2020-05-043-5/+5
| | | | | | | | | | | | | Add maximum parse tree depth to the call to asn1_init, which will be used to limit the depth of the ASN.1 parse tree. Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli: Use ARRAY_DEL_ELEMENT() in security_descriptor_acl_del()Volker Lendecke2020-03-261-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libsmb: Make sure that the TCP socket is non-blockingVolker Lendecke2020-03-251-0/+1
| | | | | | | | | | All traffic goes through smbXcli_base.c, and that is prepared to deal with short writes via the conn->outgoing queue. Instead of making sure that all callers properly set the socket nonblocking, do it here, so that we can later optimize sending out data to the server. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* py3: Remove #define PyInt_FromLong PyLong_FromLongAndrew Bartlett2020-03-232-3/+3
| | | | | | | This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power
* py3: Remove #define PyInt_AsLong PyLong_AsLongAndrew Bartlett2020-03-231-3/+3
| | | | | | | This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* py3: Remove #define PyInt_Check PyLong_CheckAndrew Bartlett2020-03-231-1/+1
| | | | | | | | This will allow us to remove some unused code in the PIDL-generated python bindings. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* libcli: Align integer typesVolker Lendecke2020-03-101-1/+1
| | | | | | | | 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 Mar 10 23:08:20 UTC 2020 on sn-devel-184
* smbd: Add make_smb2_posix_create_ctx()Volker Lendecke2020-02-073-0/+89
| | | | | | | | Will be used internally to pass an artificial posix create context into VFS_CREATE_FILE from the SMB1 unix extension calls Pair programmed with: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* libsmb: Add smb2_create_blob_remove()Volker Lendecke2020-02-072-0/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Allow passing in NULL to smb2_create_blob_find()Volker Lendecke2020-02-071-0/+4
| | | | | | | | Will simplify callers a bit, and it does not change semantics significantly. Zero create blobs won't find anything anyway. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Add posix create context definitionVolker Lendecke2020-02-071-0/+1
| | | | | Pair programmed with: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* libsmb: Add required #includes to smb_util.hVolker Lendecke2020-02-071-0/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Add required includes to smb2_create_blob.hVolker Lendecke2020-02-071-0/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Remove "const" from smb_create_blob->tagVolker Lendecke2020-02-071-1/+1
| | | | | | | I want to TALLOC_FREE that soon, and we do a talloc_strdup into this anyway. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli:smb: Don't use forward declartions for GnuTLS typedefsStefan Metzmacher2020-02-072-9/+15
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14271 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Feb 7 13:48:27 UTC 2020 on sn-devel-184
* libcli/nbt: avoid talloc_reference() in nbt_name_*_send()Stefan Metzmacher2020-02-051-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli:smb: Improve check for gnutls_aead_cipher_(en|de)cryptv2Andreas Schneider2020-02-041-5/+2
| | | | | | | | | | | | | | | This is available since version 3.6.10, but 3.6.10 has a bug which got fixed in 3.6.11, see: https://gitlab.com/gnutls/gnutls/-/merge_requests/1085 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14250 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Feb 4 06:44:00 UTC 2020 on sn-devel-184