summaryrefslogtreecommitdiff
path: root/source4
Commit message (Collapse)AuthorAgeFilesLines
* selftests: Place credential cache file inside environment directorySamuel Cabrero2019-04-291-1/+1
| | | | | | | Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:dsdb: Use C99 initializer in dsdb util_trustsAndreas Schneider2019-04-291-11/+29
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4:heimdal: Disable format truncation warningsAndreas Schneider2019-04-251-0/+5
| | | | | | | | We build that code and do not treat warnings as errors anyway, so just disable format truncation. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* selftest: Move simple-dc-steps.sh to correct folderAndrew Bartlett2019-04-231-0/+34
| | | | | | | This script helps re-create the environment for the dbcheck-oldrelease.sh links test. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4-torture: add test to check for max. number of channels per session.Sachin Prabhu2019-04-191-0/+115
| | | | | | | | Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Apr 19 18:26:18 UTC 2019 on sn-devel-144
* s4-torture: Add lease break retry tests - test4Sachin Prabhu2019-04-191-0/+190
| | | | | | | | | | | | | | Test to see how the server behaves when the client flushes data back to the server but doesn't send the lease break response over the channel. Does it then retry the lease break? This test is specifically expected to run against Samba and will not work against a MS Windows servers because it uses the ignore method to ignore oplock breaks sent by the server. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add lease break retry tests - test3Sachin Prabhu2019-04-191-0/+150
| | | | | | | | | | | | | | | Check to see how the server behaves if lease break response is sent over a different channel to one over which the break is received. The test by default blocks channels by ignoring incoming lease break requests on that channel. This does not work when testing against a windows server. Use --option=torture:use_iptables=true to use iptables to block ports instead when testing against windows servers. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add lease break retry tests - test2Sachin Prabhu2019-04-191-0/+314
| | | | | | | | | | | | | | Test to check if lease breaks are sent by the server as expected. The test by default blocks channels by ignoring incoming lease break requests on that channel. This does not work when testing against a windows server. Use --option=torture:use_iptables=true to use iptables to block ports instead when testing against windows servers. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add lease break retry tests - test1Sachin Prabhu2019-04-191-0/+213
| | | | | | | | Test to check if lease breaks are sent by the server as expected. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add oplock break retry tests - test2Sachin Prabhu2019-04-191-0/+256
| | | | | | | | | | | | | | | | Test to see if oplock break retries are sent by the server. Also checks to see if new channels can be created and used after an oplock break retry. The test by default blocks channels by ignoring incoming lease break requests on that channel. This does not work when testing against a windows server. Use --option=torture:use_iptables=true to use iptables to block ports instead when testing against windows servers. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add oplock break retry tests - test1Sachin Prabhu2019-04-191-0/+220
| | | | | | | | Test to confirm that server sends oplock breaks as expected. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add handlers to block channels for testingSachin Prabhu2019-04-191-0/+97
| | | | | | | | | | | | | | | | | | | | | We use two methods to block channels 1) Simply ignore incoming oplock break requests and do not respond to them. This method doesn't work against Microsoft Windows based servers which rely on the tcp stack for confirmation that the oplock break command was sent to the client machine. This is meant to be used with samba servers and is the default method. 2) Use iptables to block the channel. The method requires the use of a privileged account and can only be used on Linux systems with iptables installed. To use this blocking method, pass the option --option=torture:use_iptables=true Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add helper functions to create channels.Sachin Prabhu2019-04-191-1/+147
| | | | | | | | Helper functions used by both oplock and lease break tests. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add #defines required by the new testsSachin Prabhu2019-04-191-5/+68
| | | | | | | | New macros used by our tests. Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: add torture_block/torture_unblock smb2 transport functionsGünther Deschner2019-04-193-0/+416
| | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: add test for interface information retrieval for multichannel.Günther Deschner2019-04-191-4/+54
| | | | | Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Increase timeout for lease/oplock break handlersSachin Prabhu2019-04-192-4/+4
| | | | | | | | | | 0.1 seconds is not enough when running tests against a server over the network and are causing timing related bugs. We increase this to 1 second. Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add handlers to ignore incoming oplock/lease break requestsSachin Prabhu2019-04-194-0/+29
| | | | | | | | | | | | | | | | For use in multichannel oplock break tests. These handers ignore incoming oplock and lease break requests so that we can test the oplock/lease break retries on the server. This is meant for use with samba servers which rely on receiving a reply from the client before timeout. Windows servers rely on underlying tcp commands to decide if the oplock break command was delivered successfully to the client and therefore cannot be tested with this method. Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: Add function declarations to lease_break_handler.hSachin Prabhu2019-04-192-10/+11
| | | | | | | | | | | Do not completely depend on proto.h. Also move torture_reset_break_info() to lease_break_handler.h so that the layout is similar to that of oplock_break_handler.* Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: move torture_wait_for_oplock_break() to central oplock handler.Sachin Prabhu2019-04-194-109/+54
| | | | | Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: move oplock break handler out of the replay testsuite.Günther Deschner2019-04-194-77/+144
| | | | | Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: add new smb2 multichannel suite skeleton.Günther Deschner2019-04-193-0/+58
| | | | | | | | | Also Skip MC tests for s4 ntvfs fileserver, it's not supported at all. Use knownfail for s3 fileserver for the time being (until socketwrapper supports fd-passing). Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-torture: include torture/util.h in lease break handlerGünther Deschner2019-04-191-0/+2
| | | | | Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: rename schemaupgrade_dc (+pair) to schema_dcGarming Sam2019-04-121-5/+5
| | | | | | | | | | | | | | | | This is needed because the name of the autobuild job and the name of the selftest env end up in the socket path for ncalrpc sockets. The challenge is that (for example) /memdisk/autobuild/fl/b2424063/samba-schemaupgrade/bin/ab/schemaupgrade_pair_dc/ncalrpc/np/protected_storage does not fit in a struct sockaddr_un. Signed-off-by: Garming Sam <garming@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Apr 12 05:41:36 UTC 2019 on sn-devel-144
* source4: Update error check for new string conversion wrapperSwen Schillig2019-04-112-2/+2
| | | | | | | | | | | The new string conversion wrappers detect and flag errors which occured during the string to integer conversion. Those modifications required an update of the callees error checks. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* repl: test for schema object and LA repl across chunksAaron Haslett2019-04-114-8/+327
| | | | | | | | | | During replication, transmission of objects and linked attributes are split into chunks. These two tests check behavioural consistency across chunks for regular schema objects and linked attributes. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selftest: tagging tests for new schemaupgrade_dc targetAaron Haslett2019-04-111-7/+17
| | | | | | | | | Tagging schema tests against schemaupgrade_dc test target and fixing some DN assertions to be more generic. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb/repl: we need to replicate the whole schema before we can apply itStefan Metzmacher2019-04-111-10/+164
| | | | | | | | | | | Otherwise we may not be able to construct a working schema that's required to apply the changes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12204 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb:samdb: schemainfo update with relax controlAaron Haslett2019-04-111-1/+1
| | | | | | | | | | | | | | | Currently schema info's revision field isn't incremented if relax control is present. This is so that no increment is done during provision, but we need the relax control in other situations where the increment is desired, so we should use the provision control instead to disable schema info update. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13799 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4:provision: split out provision_self_join_modify_schema.ldifStefan Metzmacher2019-04-112-5/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13799 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* samdb: test for schemainfo update with relax controlAaron Haslett2019-04-112-5/+12
| | | | | | | | | | | | | | | Currently schema info's revision field isn't incremented if relax control is present. This is so that no increment is done during provision, but we need the relax control in other situations where the increment is desired. This patch adds a failing test to expose the problem. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13799 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* CVE-2019-3870 tests: Add test to check file-permissions are correct after ↵Tim Beale2019-04-082-0/+72
| | | | | | | | | | | | | provision This provisions a new DC and checks there are no world-writable files in the new DC's private directory. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ldb: tests for <= and >= integer indexingAaron Haslett2019-04-081-0/+1
| | | | | | | | | | | | | | | | Testing max, min and negative values for indexed 32 and 64 bit types. This has to be done in two different files because the 64 bit type is LDB_SYNTAX_INTEGER which is implemented at the ldb level, while the 32 bit is added in the ldb-samba module. Schema syntax binding added for ldb-samba. We also need to make sure that full scans are not invoked for LMDB. Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: Add ORDERED_INTEGER to the proto-schema handlingGarming Sam2019-04-081-0/+2
| | | | | | | | | Adding ordered integer proto schema handling in kv index cache. This allows ordered 64 bit integers to be used in cached fields like @ATTRIBUTES Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: activating <= and >= indexing for integersAaron Haslett2019-04-082-2/+2
| | | | | | | | | | | | | | | Activating <= and >= mdb indexing in samba for int32 and int64 attributes by: 1. Adding index_format_fn to LDB_SYNTAX_SAMBA_INT32 in ldb_samba 2. Cloning the 64bit LDB_SYNTAX_INTEGER type as LDB_SYNTAX_ORDERED_INTEGER 3. Adding index_format_fn to the new type 4. Modifying LargeInteger use the new type in samba schema 5. Bumping the index version to trigger reindexing Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libnet vampire: NULL access bug fixGarming Sam2019-04-081-1/+6
| | | | | | | | NULL pointer access bug fix Signed-off-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb/modules: minor comment typos in samba_dsdbDouglas Bagnall2019-04-051-2/+4
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb mods/extended_dn_store: used the ldb we already haveDouglas Bagnall2019-04-051-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* spell "recursive"Douglas Bagnall2019-04-051-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* provision: use ASCII quotesPhilipp Gesang2019-04-031-1/+1
| | | | | | | | Remove some Unicode quotes that cause problems under the C locale. Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* oLschema2ldif: Resolve multiple parsing bugsMichael Hanselmann2019-04-034-4/+238
| | | | | | | | | | | | | | | | | | | | | | | | The "oLschema2ldif" program contained multiple bugs triggered by malformed inputs: * Iteration beyond list of recognized dsdb syntax OIDs when value wasn't found (bug 9567) * NULL pointer dereference when input didn't define a name * Heap buffer overflows for unterminated token values Tests are added to reproduce all identified bugs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9567 Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Then adapted to use ARRAY_SIZE() consistently as suggested by metze. Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 3 02:43:07 UTC 2019 on sn-devel-144
* Relax GPGME version checkMathieu Parent2019-04-031-2/+10
| | | | | | | | | | | | | | The current method require at least the same version as during the build. This is not needed. Used symbols indicate the minimum is 1.2.0 Bug-Debian: http://bugs.debian.org/886333 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13880 Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4:rpc_server: add missing newline to error debug messageBjörn Baumbach2019-04-031-1/+1
| | | | | | | | Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 3 00:13:10 UTC 2019 on sn-devel-144
* samba_dnsupdate: small tweaks to make code more pythonicJoe Guo2019-04-021-49/+19
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* Spelling fix s/informations/information/Mathieu Parent2019-04-028-11/+11
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* libsmb: Make "struct smb2_lock_element" generally usableVolker Lendecke2019-04-011-6/+1
| | | | | | | | This struct will be of interest when we add locking capabilities to libcli/smb/smb2cli* Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Rename InfoType from [MS-SMB2] according to the specVolker Lendecke2019-04-015-18/+21
| | | | | | | This makes it easier to find this via internet search Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* acl_read: Fix regression caused by db15fcfa899e1fe4d6994f68ceb299921b8aa6f1 ↵Garming Sam2019-03-291-3/+0
| | | | | | | | | | | | | | | | | | | | | | | for empty lists The original code never dereferenced attrs and only added "*" if attrs was NULL (not if attrs[0] was NULL). This causes significant performance issues with the new paged_results module introduced for 4.10 as the initial GUID search requests no attributes. This GUID search turns into a search for "*" and ends up allocating memory for the entire database. This never appears to cause changes in the final result set, only intermediate processing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13836 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): Fri Mar 29 18:37:29 UTC 2019 on sn-devel-144
* ldb: cmocka test for empty attributes bugAaron Haslett2019-03-293-0/+105
| | | | | | | | | | | | Cmocka test exposing LDB bug where a request with an empty attributes list returns a response containing all attributes. The bug is in the ACL module and will be fixed in the next commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13836 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* paged_search: perf testing paged searchAaron Haslett2019-03-291-2/+9
| | | | | | | | | | Adding medley performance run with paged search module. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13836 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>