summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib: Hold at most 10 outstanding paged result cookiesVolker Lendecke2018-09-271-0/+22
| | | | | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13362 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 May 15 09:37:21 CEST 2018 on sn-devel-144 (cherry picked from commit 9fbd4672b06de5333a9c44fc126b8edac0b9d31a) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Thu Sep 27 15:32:11 CEST 2018 on sn-devel-144
* lib: Put "results_store" into a doubly linked listVolker Lendecke2018-09-271-20/+5
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13362 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 8063995a92fffc93aa9d6d1d92a75bf3f3c9592b)
* krb5-samba: interdomain trust uses different salt principalAlexander Bokovoy2018-09-052-17/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Salt principal for the interdomain trust is krbtgt/DOMAIN@REALM where DOMAIN is the sAMAccountName without the dollar sign ($) The salt principal for the BLA$ user object was generated wrong. dn: CN=bla.base,CN=System,DC=w4edom-l4,DC=base securityIdentifier: S-1-5-21-4053568372-2049667917-3384589010 trustDirection: 3 trustPartner: bla.base trustPosixOffset: -2147483648 trustType: 2 trustAttributes: 8 flatName: BLA dn: CN=BLA$,CN=Users,DC=w4edom-l4,DC=base userAccountControl: 2080 primaryGroupID: 513 objectSid: S-1-5-21-278041429-3399921908-1452754838-1597 accountExpires: 9223372036854775807 sAMAccountName: BLA$ sAMAccountType: 805306370 pwdLastSet: 131485652467995000 The salt stored by Windows in the package_PrimaryKerberosBlob (within supplementalCredentials) seems to be 'W4EDOM-L4.BASEkrbtgtBLA' for the above trust and Samba stores 'W4EDOM-L4.BASEBLA$'. While the salt used when building the keys from trustAuthOutgoing/trustAuthIncoming is 'W4EDOM-L4.BASEkrbtgtBLA.BASE', which we handle correct. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13539 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Alexander Bokovoy <ab@samba.org> 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): Wed Sep 5 03:57:22 CEST 2018 on sn-devel-144 (cherry picked from commit f3e349bebc443133fdbe4e14b148ca8db8237060) Autobuild-User(v4-8-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-8-test): Wed Sep 5 18:32:05 CEST 2018 on sn-devel-144
* s3: util: Do not take over stderr when there is no log filePaulo Alcantara2018-09-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case we don't have either a /var/log/samba directory, or pass a non-existent log directory through '-l' option, all commands that are daemonized with '-D' option hang when executed within a subshell. An example on how to trigger that: # rm -r /var/log/samba # s=$(nmbd -D -s /etc/samba/smb.conf -l /foo123) (never returns) So, when the above command is executed within a subshell the following happens: (a) Parent shell creates a pipe, sets write side of it to fd 1 (stdout), call read() on read-side fd, forks off a new child process and then executes nmbd in it. (b) nmbd sets up initial logging to go through fd 1 (stdout) by calling setup_logging(..., DEBUG_DEFAULT_STDOUT). 'state.fd' is now set to 1. (c) reopen_logs() is called by the first time which then calls reopen_logs_internal() (d) in reopen_logs_internal(), it attempts to create log.nmbd file in /foo123 directory and fails because directory doesn't exist. (e) Regardless whether the log file was created or not, it calls dup2(state.fd, 2) which dups fd 1 into fd 2. (f) At some point, fd 0 and 1 are closed and set to /dev/null The problem with that is because parent shell in (a) is still blocked in read() call and the new write side of the pipe is now fd 2 -- after dup2() in (e) -- and remains unclosed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13578 Signed-off-by: Paulo Alcantara <palcantara@suse.de> Reviewed-by: Jim McDonough <jmcd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Aug 18 01:32:25 CEST 2018 on sn-devel-144 (cherry picked from commit 41aa55f49233ea7682cf14e5a7062617274434ce)
* ldb: Release LDB 1.3.6ldb-1.3.6Andrew Bartlett2018-08-234-1/+284
| | | | | | * make test fails on ldb 1.3.4 due to missing NULL terminator in tests (bug 13575) Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* ldb: Fix missing NULL terminator in ldb_mod_op_test testsuiteAndrew Bartlett2018-08-231-2/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13575 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> (cherry picked from commit f8b368c9f0c2a34b6d15303a9d6facd762e1a517)
* Merge tag 'samba-4.8.4' into v4-8-testKarolin Seeger2018-08-149-2/+503
|\ | | | | | | samba: tag release samba-4.8.4
| * ldb: Release LDB 1.3.5 for CVE-2018-1140ldb-1.3.5Andrew Bartlett2018-08-114-1/+284
| | | | | | | | | | | | | | * Security fix for CVE-2018-1140 (NULL pointer de-reference, bug 13374) Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
| * CVE-2018-1140 ldb: Add tests for search add and rename with a bad dn= DNAndrew Bartlett2018-08-111-0/+156
| | | | | | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13374
| * CVE-2018-1140 ldb_tdb: Check for DN validity in add, rename and searchAndrew Bartlett2018-08-112-1/+42
| | | | | | | | | | | | | | | | | | This ensures we fail with a good error code before an eventual ldb_dn_get_casefold() which would otherwise fail. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13374
| * CVE-2018-1140 ldb_tdb: Ensure the dn in distinguishedName= is valid before useAndrew Bartlett2018-08-111-0/+9
| | | | | | | | | | | | | | | | | | ldb_dn_from_ldb_val() does not validate this untrusted input, so a later call to ldb_dn_get_casefold() can fail if the input is not valid. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13374
| * CVE-2018-1140 ldb: Check for ldb_dn_get_casefold() failure in ldb_sqliteAndrew Bartlett2018-08-111-0/+3
| | | | | | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13374
| * CVE-2018-1140 Add NULL check for ldb_dn_get_casefold() in ltdb_index_dn_attr()Andrej Gessel2018-08-111-0/+9
| | | | | | | | | | | | | | Signed-off-by: Andrej Gessel <Andrej.Gessel@janztec.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13374
* | ldb: Refuse to build Samba against a newer minor version of ldbAndrew Bartlett2018-08-131-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Samba is not compatible with new versions of ldb (except release versions) Other users would not notice the breakages, but Samba makes many more assuptions about the LDB internals than any other package. (Specifically, LDB 1.2 and 1.4 broke builds against released Samba versions) BUG: https://bugzilla.samba.org/show_bug.cgi?id=13519 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> (cherry picked from commit 52efa796538ae004ca62ea32fc8c833472991be6)
* | lib: smb_threads: fix access before init bugRalph Boehme2018-07-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | talloc_stackframe_internal() calls SMB_THREAD_GET_TLS(global_ts) which calls smb_get_tls_pthread() in the POSIX pthread wrapper implementation. If SMB_THREAD_SET_TLS() hasn't been called before, global_ts is NULL and smb_get_tls_pthread dereferences it so it crashes. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13505 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit e311801e0e7171a2b50e39d3e0c2d2137f8b3d7e)
* | tdb: Fix build on AIXAmitay Isaacs2018-07-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Here is the build error on AIX 7.1. ../../lib/tdb/tools/tdbtool.c:39:12: error: 'disable_lock' redeclared as different kind of symbol static int disable_lock; ^~~~~~~~~~~~ In file included from /usr/include/sys/gfs.h:24:0, from /usr/include/sys/vfs.h:27, from ../../lib/replace/system/filesys.h:48, from ../../lib/tdb/tools/tdbtool.c:26: /usr/include/sys/lock_def.h:314:5: note: previous declaration of 'disable_lock' was here int disable_lock(int,simple_lock_t); ^~~~~~~~~~~~ Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit edffe4d16514fa0c87655e040842f6c20d89791c)
* | replace: Add test for sin6_len in sockaddr_in6 structureAmitay Isaacs2018-07-101-0/+4
|/ | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 7eeba9c5a4541e581b062fb9ee26f13b7373c541)
* ldb: version 1.3.4ldb-1.3.4Andrew Bartlett2018-06-264-1/+284
| | | | | | | | | | | * Fix memory leaks and missing error checks (bug 13459, 13471, 13475) * Fix fallback to full scan (performance regression) on one-level search (bug 13448) * Fix read corruption (missing results) during writes, particularly during a Samba subtree rename (bug 13452) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Tue Jun 26 13:31:53 CEST 2018 on sn-devel-144
* Fix several mem leaks in ldb_index ldb_search ldb_tdbAndrej Gessel2018-06-263-3/+10
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13475 Signed-off-by: Andrej Gessel <Andrej.Gessel@janztec.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jun 15 23:07:25 CEST 2018 on sn-devel-144 (cherry picked from commit 3ca1c09f686fbfa9257cd95710dba4a98c3eeb8f)
* check return value before using key_valuesAndrej Gessel2018-06-261-3/+10
| | | | | | | | | | | there are also mem leaks in this function BUG: https://bugzilla.samba.org/show_bug.cgi?id=13475 Signed-off-by: Andrej Gessel <Andrej.Gessel@janztec.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit f75e8f58cd2390c092631803d333adadb475306a)
* ldb: check return valuesAndrej Gessel2018-06-262-1/+11
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13475 Signed-off-by: Andrej Gessel <Andrej.Gessel@janztec.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 6b52d21e6040699a72aff12fd6ebb34534dcb457)
* ldb_tdb: Use mem_ctx and so avoid leak onto long-term memory on duplicated add.Andrew Bartlett2018-06-261-1/+1
| | | | | | | | | | | | | | | | | | After a duplicated add a small amount of memory can be leaked onto a long-term context. Found by Andrej Gessel https://github.com/andiges https://github.com/samba-team/samba/commit/e8fb45125e6a279b918694668e0d4fbddac10aee#commitcomment-29334102 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13471 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jun 15 04:39:41 CEST 2018 on sn-devel-144 (cherry picked from commit f4f3abfa0e18bb4968b37b1cac40cd8c185c8d7b)
* ldb: Fix memory leak on module contextLukas Slebodnik2018-06-261-2/+2
| | | | | | | | | | | | | | | Introduced in e8cdacc509016d9273d63faf334d9f827585c3eb BUG: https://bugzilla.samba.org/show_bug.cgi?id=13459 Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jun 1 11:10:24 CEST 2018 on sn-devel-144 (cherry picked from commit d161aa3522576545d269208426bb0014ee2ab35f)
* ldb: Add tests for when we should expect a full scanAndrew Bartlett2018-06-264-2/+135
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13448 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit e99c199d811e607e7867e7b40d82a1642226c647)
* ldb: One-level search was incorrectly falling back to full DB scanAndrew Bartlett2018-06-261-11/+12
| | | | | | | | | | | | | | | | | | When no search filter is specified, the code falls back to using '(|(objectClass=*)(distinguishedName=*)'. ltdb_index_dn() then failed because matching against '*' is not indexed. The error return then caused the code to fallback to a full-scan of the DB, which could have a considerable performance hit. Instead, we want to continue on and do the ltdb_index_filter() over the indexed results that were returned. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13448 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit 88ae60ed186c9c479722ad62d65a07d0c2e71469)
* ldb: Explain why an entry can vanish from the indexAndrew Bartlett2018-06-261-1/+6
| | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit 9e143ee9b9f7be53c193cee3153f64c4dedc07e9)
* ldb: Indicate that the ltdb_dn_list_sort() in list_union is a bit subtle.Andrew Bartlett2018-06-261-0/+3
| | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit 3632775d7ad31e06437ed76b8731d9895930caa1)
* ldb: Save a copy of the index result before calling the callbacks.Andrew Bartlett2018-06-262-18/+336
| | | | | | | | | | | Otherwise Samba modules like subtree_rename can fail as they modify the index during the callback. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13452 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit d02cd236dcbd8a44ecc85d1f7e95a48c95c0a479)
* krb5_wrap: fix keep_old_entries logic for older kerberos librariesChristof Schmitt2018-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | MIT kerberos 1.13 and older only stores 8 bits of the KVNO. The change from commit 35b2fb4ff32 resulted in breakage for these kerberos versions: 'net ads keytab create' reads a large KVNO from AD, and only the lower 8 bits are stored. The next check then removed the entry again as the 8 bit value did not match the currently valid KVNO. Fix this by limiting the check to only 8 bits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13478 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Sat Jun 23 00:57:47 CEST 2018 on sn-devel-144 (cherry picked from commit 97eaeea6a130871cfac5be42459380c0c4e0fae6)
* lib:util: Fix size types in debug.cAndreas Schneider2018-06-201-7/+7
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit fb6cd9c44ac6fcc9f6abe3b63fc742aeac42969a)
* lib:util: Fix parameter aliasing in tfork testAndreas Schneider2018-06-201-5/+2
| | | | | | | | | | | | | | | | ../lib/util/tests/tfork.c:483:24: error: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Werror=restrict] ret = pthread_create(&threads[i], ^~~~~~~~~~~ ../lib/util/tests/tfork.c:486:10: (void *)&threads[i]); ~~~~~~~~~~~~~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit 6f06a0154f5769cb85f6e189eecd78cd7805090a)
* lib:util: Fix string check in mkdir_p()Andreas Schneider2018-06-201-2/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit 7cec343a89a0862c09f5ddd4707eb442157a4af2)
* memcache: Add new cache type for dfree informationChristof Schmitt2018-06-071-1/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13446 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit f5d05562679f6aa691b98b4a75952f7dda7ed343)
* lib/util: Call log_stack_trace() in smb_panic_default()Andrew Bartlett2018-06-041-2/+1
| | | | | | | | | | | | | | | | This matches the AD DC with the behaviour in smbd. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13454 Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 11 04:03:07 CEST 2018 on sn-devel-144 (cherry picked from commit 462eb4a44cc51dc17aebbcd5c609c9ff7f088554) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Mon Jun 4 14:30:55 CEST 2018 on sn-devel-144
* lib/util: Move log_stack_trace() to common codeAndrew Bartlett2018-06-043-0/+106
| | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13454 (cherry picked from commit bf9551902afdb32310db4a3381964c435dd08bf0)
* lib/util: Log PANIC before calling pacic action just like s3Andrew Bartlett2018-06-041-1/+3
| | | | | | | | | | This is like the changes made in s3 by 4fa555980070d78b39711ef21d77628d26055bc2 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13454 (cherry picked from commit 3acc00b6808d5d5ad035d9d43526204db1608c8a)
* ldb: Release ldb 1.3.3ldb-1.3.3Andrew Bartlett2018-05-024-1/+284
| | | | | | | | | | * Fix failure to upgrade to the GUID index DB format * Add tests for GUID index behaviour BUG: https://bugzilla.samba.org/show_bug.cgi?id=13306 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ldb: Add test to show a reindex failure must not leave the DB corruptAndrew Bartlett2018-05-021-0/+160
| | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13335 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Apr 5 07:53:10 CEST 2018 on sn-devel-144 (cherry picked from commit 653a0a1ba932fc0cc567253f3e153b2928505ba2)
* lib ldb tests: Prepare to run api and index test on tdb and lmdbGary Lockyer2018-05-022-60/+114
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13335 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 06d9566ef7005588de18c5a1d07a5b9cd179d17b)
* ldb_tdb: Ensure we can not commit an index that is corrupt due to partial ↵Andrew Bartlett2018-05-022-0/+32
| | | | | | | | | | | | | re-index The re-index traverse can abort part-way though and we need to ensure that the transaction is never committed as that will leave an un-useable db. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13335 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> (cherry picked from commit e481e4f30f4dc540f6f129b4f2faea48ee195673)
* ldb_tdb: Add tests for truncated index keysGary Lockyer2018-05-022-1/+1008
| | | | | | | | | | | | | | | | | | | | Tests for the index truncation code as well as the GUID index format in general. Covers truncation of both the DN and equality search keys. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 3 09:58:40 CET 2018 on sn-devel-144 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13335 (cherry picked into 4.8 and cut down to operate without truncated index values from master commit 4c0c888b571d4c21ab267024178353925a8c087c by Andrew Bartlett)
* ldb_tdb: Do not fail in GUID index mode if there is a duplicate attributeGary Lockyer2018-05-021-7/+57
| | | | | | | | | | | | | | | | | | It is not the job of the index code to enforce this, but do give a a warning given it has been detected. However, now that we do allow it, we must never return the same object twice to the caller, so filter for it in ltdb_index_filter(). The GUID list is sorted, which makes this cheap to handle, thankfully. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13335 (cherry picked from commit 5c1504b94d1417894176811f18c5d450de22cfd2)
* ldb/tests: avoid 'return void_function();' which isn't portableStefan Metzmacher2018-04-201-4/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> (cherry picked from commit 666dda907b7f190b2dff1f2639bd2518240b9fb2)
* lib/crypto: avoid 'return void_function();' which isn't portableStefan Metzmacher2018-04-201-4/+6
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> (cherry picked from commit 7ae77db3b29ef08e1f74aa413049b995a598a5dd)
* lib/replace: define __[u]intptr_t_defined if we prove an replacementStefan Metzmacher2018-04-201-0/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> (cherry picked from commit 329a229af3c3c9475b9254ca68c413ec18fa3b71)
* lib/util: remove unused '#include <sys/syscall.h>' from tests/tfork.cStefan Metzmacher2018-04-201-1/+0
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13342 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit f2ff61ce9e8ab56d8a69fce29c9f214d5d98f89e)
* Allow AESNI to be used on all processor supporting AESNI, not just Intel's ↵Eric Vannier2018-04-061-16/+0
| | | | | | | | | | | | | | | This improves performance/reduced CPU usage. Tests performed: - Ran on Ivy Bridge and Ryzen and verified that AESNI is detected (crypto tests) - Ran on Ryzen, and observed 50% increased speed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13302 Signed-off-by: Eric Vannier <evannier@google.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 27 13:50:09 CEST 2018 on sn-devel-144 (cherry picked from commit 77d88d75f6262a855e818a9b2b4018f8b6ced7b0)
* s3: smbd: SMB2: Add DBGC_SMB2_CREDITS class to specifically debug credit issues.Jeremy Allison2018-04-062-0/+2
| | | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> (cherry picked from commit ad973fddef00d6d92443be89e7f5404006a94d99)
* lib: debug: Add DBGC_XXX versions of the macros to allow class-specific ↵Jeremy Allison2018-04-061-0/+30
| | | | | | | | | | messages. https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> (cherry picked from commit cdde6d93605d15a59e816a35e8e02ca193bf1403)
* s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all ↵Jeremy Allison2018-04-062-0/+2
| | | | | | | | | | | | smbd/smb2_*.c files with it. Will allow easier smb2-specific debugging. https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> (cherry picked from commit 8dabcf8948c2e514b489169c34673e093519b583)