summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* ldb/tests/py/api: reveal shadowed casefold testDouglas Bagnall2018-10-251-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* tdb/test/_tdbtext: remove unused importsDouglas Bagnall2018-10-251-1/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* talloc/test/pytalloc: remove unused importsDouglas Bagnall2018-10-251-1/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* ldb/tests/_ldb_text: remove unused importsDouglas Bagnall2018-10-251-3/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* ldb-samba/tests/match-rules: remove unused importsDouglas Bagnall2018-10-251-4/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* tdbtorture: Align integer typesVolker Lendecke2018-10-251-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tdbtorture: No transaction with mutexesVolker Lendecke2018-10-251-5/+16
| | | | | | | | | | Right now we don't do transactions with mutexed tdbs. tdbtorture -m locks up. I haven't really investigated why that is the case. The lockup confused me quite a bit until I figured out it works fine as long as it does not do transactions, which is all we need right now. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tdb: Remove "USE_RIGHT_MERGES" codeVolker Lendecke2018-10-251-57/+0
| | | | | | | | | | This has not been activated by default for ages and can be very inefficient. With check_merge_with_left_record() we have an alternative that will merge freelist records while we walk it anyway. This has reduced fragmentation significantly Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tdb: Fix a typoVolker Lendecke2018-10-251-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tdb: Use explicit initializationVolker Lendecke2018-10-251-3/+1
| | | | | | | Let the compiler figure out the optimal code Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tdb: Avoid castsVolker Lendecke2018-10-251-3/+3
| | | | | | | We have %PRIu32 and %zu these days Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* talloc: deprecate talloc_set_memlimit()David Disseldorp2018-10-191-1/+11
| | | | | | | | The memlimit functionality was never utilized by Samba. It adds unneeded complexity, so flag it as deprecated. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ldb_ldif: avoid strlen(NULL)Douglas Bagnall2018-10-191-1/+2
| | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Oct 19 03:43:58 CEST 2018 on sn-devel-144
* ldb_ldif: be less horribly efficient in debuggingDouglas Bagnall2018-10-181-3/+3
| | | | | | | | | | perf said all the time was in strlen. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Thu Oct 18 13:17:30 CEST 2018 on sn-devel-144
* replace: Add memset_s() if not availableAndreas Schneider2018-10-163-0/+56
| | | | | | | See https://en.cppreference.com/w/c/string/byte/memset Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* lib: Remove lib/crypto/crc32.[ch]Volker Lendecke2018-10-104-107/+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): Wed Oct 10 01:41:52 CEST 2018 on sn-devel-144
* lib: Avoid the use of open_memstream in tevent_req_profile_stringVolker Lendecke2018-10-083-57/+51
| | | | | | | | Solaris does not have it. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13629 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Basic test for circular freelist fixVolker Lendecke2018-10-083-0/+51
| | | | | | | | Try to store a record for which the (circular) freelist does not have any entry. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Basic test for circular hash chain fixVolker Lendecke2018-10-083-0/+43
| | | | | | | This just walks tdb_find by searching for a nonexistent record Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Make the freelist walk circular-safeVolker Lendecke2018-10-081-0/+15
| | | | | | | | | We can't really do the full check while the freelist is modified on the fly. As long as we don't merge any freelist entries, we should be good to apply this check. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Align integer typesVolker Lendecke2018-10-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Make get_hash_length circular-safeVolker Lendecke2018-10-081-0/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Make tdb_find_dead circular-safeVolker Lendecke2018-10-081-0/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Make tdb_dump_chain circular-list safeVolker Lendecke2018-10-081-0/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Make tdb_find circular-safeVolker Lendecke2018-10-081-5/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Add tdb_chainwalk_checkVolker Lendecke2018-10-082-0/+39
| | | | | | | | | | | This captures the tdb_rescue protection against circular hash chains with a slow pointer updated only on every other record traverse If a hash chain has a loop, eventually the next_ptr will cycle around and be identical to the 'slow' pointer. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/ldb: Ensure ldb.Dn can accept utf8 encoded unicodeNoel Power2018-09-271-13/+17
| | | | | | | | Additionally remove the associated known fail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13616 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/ldb/tests: add test for ldb.Dn passed utf8 unicodeNoel Power2018-09-271-0/+4
| | | | | | | | | | | | | object dn format should be a utf8 encoded string Note: Currently this fails in python2 as the c python binding for the dn string param uses PyArg_ParseTupleAndKeywords() with 's' format, this will accept str *or* unicode in the default encoding. The default encoding in python2 is... ascii. Also adding here a knownfail to squash the error produced by the test. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/ldb: Test correct variable for no mem conditionNoel Power2018-09-271-1/+1
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* turn --with-json-audit into global --with-jsonPhilipp Gesang2018-09-261-36/+0
| | | | | | | | | | Fold the build option --with-json-audit into the toplevel wscript to reflect the fact that JSON support is no longer local to the audit subsystem. Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/audit_logging: make json_{is_invalid,to_string}() accept a const*Philipp Gesang2018-09-222-4/+4
| | | | | | | | | | Allow for json_is_invalid() and json_to_string() to be used on a const pointer. Neither function requires for the json object to be mutable so constraining them to non-const* is unnecessary. Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: Fix dependency of ldb moduleAmitay Isaacs2018-09-211-1/+1
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13626 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: detect talloc_utils (for version of python running the build)Noel Power2018-09-161-2/+2
| | | | | | | | | | | | It seems all combinations have potential to fail here :/ however for the moment making the assumption * if python2 driving the build you are building against libpython2 (with the option of having python3 as 'extra-python' * if python3 driving the build you are building against libpython3 (with the option of having python3 as 'extra-python' NOTE: this isn't inforced it probably should be !!!! In a system with python2 and python3 installed it seems waf needs PYTHON env variable to decide which libpython to build against. It's also an option that configure should use that too (to figure out which talloc_util to use or build) However.... right now I just want the thing to build Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: fix iteritems usage, not supported in python3Noel Power2018-09-161-2/+2
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture: Remove unnecesssary #include <fcntl.h>Christof Schmitt2018-09-151-1/+0
| | | | | | | This is now provided through system/filesys.h. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tevent: Fix a docu typoVolker Lendecke2018-09-141-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap_tdb: Avoid double-call to talloc_get_type_abortVolker Lendecke2018-09-141-5/+6
| | | | | | | We've already retrieved "ctx" in the callers of db_tdb_fetch_locked_internal(). Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap_tdb: use struct initializerRalph Boehme2018-09-121-2/+3
| | | | | | | This ensures all struct members are implicitly initialized. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_tdb: move a function call out of an if conditionRalph Boehme2018-09-121-3/+6
| | | | | | | | At least for me this improves readability somewhat. No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Revert "lib/replace: force to unset defines if check has failed"Stefan Metzmacher2018-09-101-2/+1
| | | | | | | | | This reverts commit 8ec7eb0c0129518557d1f446191860a62ef3ff79. There was already a better fix under discusion. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/replace: force to unset defines if check has failedAlexander Bokovoy2018-09-081-1/+2
| | | | | | | | | | For HAVE_WORKING_STRPTIME and HAVE_INCOHERENT_MMAP we always want to have their defines unset as the code is using '#ifdef' rather than just '#if'. Setting them to 0 means #ifdef will succeed due to a difference how '#ifdef' and '#if' are working. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbwrap: Remove a pointless "return;"Volker Lendecke2018-09-071-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* lib/replace/wscript: fix detection of a fallthrough attribute for clangAlexander Bokovoy2018-09-071-0/+1
| | | | | | | | | | | | | | clang issues a warning but otherwise allows our test to be compiled and linked. We consider this case a successful pass for a fallthrough attribute detection while it is an error. Turn missing declaration warning into an error so that we actually do not define fallthrough attribute support in case it doesn't really work. Fixes FreeBSD 11.2 with clang. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PEP8: fix E128: continuation line under-indented for visual indentJoe Guo2018-09-061-1/+1
| | | | | | | | | Signed-off-by: Joe Guo <joeg@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): Thu Sep 6 15:50:17 CEST 2018 on sn-devel-144
* lib/mscat: fix logging in wscriptAlexander Bokovoy2018-09-051-1/+1
|
* lib/audit_logging: update to waf 2.0Alexander Bokovoy2018-09-051-2/+2
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* auth/wscript: import from waflibAlexander Bokovoy2018-09-051-1/+1
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* auth/wscript: fix options useAlexander Bokovoy2018-09-051-1/+1
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util/wscript_configure: update to handle waf 2.0.4Alexander Bokovoy2018-09-051-1/+1
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util/wscript: update to handle waf 2.0.4Alexander Bokovoy2018-09-051-1/+1
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>