summaryrefslogtreecommitdiff
path: root/lib/tdb
Commit message (Collapse)AuthorAgeFilesLines
* python: Safely clear structure membersJoseph Sutton2023-05-161-1/+1
| | | | | | | | Using Py_CLEAR() ensures that these structures are observed in a consistent state by any Python code that may run during deconstruction. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:tdb: Fix code spellingAndreas Schneider2023-04-147-13/+13
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* tdb/pytdb: remove useless HAVE_ITER non-flagDouglas Bagnall2023-02-031-3/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/pytdb: remove py ifdefsDouglas Bagnall2023-02-031-44/+0
| | | | | | | | This already would not compile with Python 2, because Py_TPFLAGS_HAVE_ITER is not defined Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Python: remove pydoctorRob van der Linde2023-02-021-3/+0
| | | | | | | | | | | | | | | | | | | Removes: * waf pydoctor * waf wafdocs * make pydoctor There is no "make wafdocs" it only appears to be in wscript. The reasoning being is these are broken and appear to not have been run for some time. Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 2 21:15:54 UTC 2023 on atb-devel-224
* tdb: version 1.4.8tdb-1.4.8Stefan Metzmacher2023-01-182-1/+74
| | | | | | | * Support python 3.12 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jule Anger <janger@samba.org>
* tdb: Move 160 bytes from R/W data segment to R/O textVolker Lendecke2022-12-151-18/+35
| | | | | | | | The linker has to relocate the pointers in the array at startup, save that. I know we have bigger .data blobs, but every bit counts :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: version 1.4.7tdb-1.4.7Stefan Metzmacher2022-06-082-1/+74
| | | | | | | | | | | | * Fix build problems BUG: https://bugzilla.samba.org/show_bug.cgi?id=15071 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): Wed Jun 8 17:57:53 UTC 2022 on sn-devel-184
* configure/Makefile: export PYTHONHASHSEED=1 in all 'configure/Makefile' scriptsStefan Metzmacher2022-03-291-0/+7
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:tdb: Reformat shell scriptsAndreas Schneider2022-02-242-14/+17
| | | | | | shfmt -f lib/tdb/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb: version 1.4.6tdb-1.4.6Stefan Metzmacher2022-01-242-1/+74
| | | | | | | * Use atomic operations for tdb_[increment|get]_seqnum Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jule Anger <janger@samba.org>
* tdb: Raw performance torture to beat tdb_increment_seqnumVolker Lendecke2021-12-152-0/+128
| | | | | | | | | | | | Running this on sn-devel-184 takes ~14 seconds with the atomic ops. Without them I did not wait for it to finish. After reducing NPROCS from 500 to 50 it still ran for more than a minute. 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 Dec 15 01:03:56 UTC 2021 on sn-devel-184
* tdb: Use atomic operations for tdb_[increment|get]_seqnumVolker Lendecke2021-12-151-0/+24
| | | | | | | | | | | | | | | | | | | | With locking.tdb now based on g_lock.c code, we change locking.tdb a lot more often. I have a customer case where LDX tortures smbd very hard with 800+ concurrent connections, which now completely falls over where 4.12 still worked fine. Some debugging showed a thundering herd on fcntl locking.tdb index 48 (TDB_SEQNUM_OFS). We still use fcntl for the seqnum, back when we converted the chainlocks to mutexes we did not consider it to be a problem. Now it is, but all we need to do with the SEQNUM is to increment it, so an __atomic_add_fetch() of one is sufficient. I've taken a look at the C11 standard atomics, but I could not figure out how to use them properly, to me they seem more general to be initialized first etc. All we need is a X86 "lock incl 48(%rax)" to be emitted, and the gcc __atomic_add_fetch seems to do this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Fix Python docstringsJoseph Sutton2021-09-041-1/+1
| | | | | | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Sep 4 00:55:32 UTC 2021 on sn-devel-184
* tdb: version 1.4.5tdb-1.4.5Stefan Metzmacher2021-07-202-1/+74
| | | | | | | | | | * fix standalone usage of tdb.h Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jul 20 11:48:38 UTC 2021 on sn-devel-184
* tdb: Fix invalid syntax in tdb.hGünther Deschner2021-07-201-0/+13
| | | | | | | | | | | | | | Defining _PUBLIC_ in the same way as in talloc.h resolves an issue with a previous fix for Solaris Studio compiler 12.4 that prefixed all calls in tdb.h with _PUBLIC_. Thanks to Lukas Slebodnik <lslebodn@redhat.com>. Bug: https://bugzilla.samba.org/show_bug.cgi?id=14762 Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: version 1.4.4tdb-1.4.4Stefan Metzmacher2021-07-142-1/+74
| | | | | | | | | | | | | | | | | | | | | - Fix a memory leak on error - python: remove all 'from __future__ import print_function' - Fix CID 1471761 String not null terminated - Use hex_byte() in parse_hex() - Use hex_byte() in read_data() - fix studio compiler build - Fix some signed/unsigned comparisons - also use __has_attribute macro to check for attribute support - Fix clang 9 missing-field-initializer warnings - pytdb tests: add test for storev() - pytdb: add python binding for storev() - tdbtorture: Use ARRAY_DEL_ELEMENT() - py3: Remove #define PyInt_FromLong PyLong_FromLong - py3: Remove #define PyInt_AsLong PyLong_AsLong - py3: Remove #define PyInt_Check PyLong_Check - tdb: Align integer types Signed-off-by: Stefan Metzmacher <metze@samba.org>
* lib:tdb: Fix a memory leak on errorAndreas Schneider2021-07-081-0/+1
| | | | | | | Found by covscan. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* python: remove all 'from __future__ import print_function'Douglas Bagnall2021-04-281-1/+0
| | | | | | | | | | | | | | | | This made Python 2's print behave like Python 3's print(). In some cases, where we had: from __future__ import print_function """Intended module documentation...""" this will have the side effect of making the intended module documentation work as the actual module documentation (i.e. becoming __doc__), because it is once again the first statement in the module. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb: Fix CID 1471761 String not null terminatedVolker Lendecke2021-01-141-1/+1
| | | | | | | | This is a false positive (in is length 3 initialized to 0), but this patch does not hurt Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org>
* tdb: Use hex_byte() in parse_hex()Volker Lendecke2021-01-081-22/+2
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Use hex_byte() in read_data()Volker Lendecke2021-01-081-31/+10
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: fix studio compiler buildBjörn Jacke2020-11-102-71/+73
| | | | | | | | | | Solaris Studio compiler 12.4 is pedantic about prototypes in headers having the external visibility declarations too. It throws errors like: redeclaration must have the same or more restrictive linker scoping: ... Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb: Fix some signed/unsigned comparisonsMartin Schwenke2020-07-161-2/+3
| | | | | | | | | | | | | | | [207/389] Compiling lib/tdb/tools/tdbdump.c ../../../lib/tdb/tools/tdbrestore.c: In function ‘read_linehead’: ../../../lib/tdb/tools/tdbrestore.c:43:13: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] 43 | for (i=0; i<sizeof(prefix); i++) { | ^ ../../../lib/tdb/tools/tdbrestore.c: In function ‘read_data’: ../../../lib/tdb/tools/tdbrestore.c:95:13: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 95 | for (i=0; i<size; i++) { | ^ Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdb: also use __has_attribute macro to check for attribute supportBjörn Jacke2020-05-241-1/+1
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix clang 9 missing-field-initializer warningsGary Lockyer2020-05-081-1/+1
| | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* pytdb tests: add test for storev()Jule Anger2020-05-051-0/+4
| | | | | | | | | Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue May 5 11:24:52 UTC 2020 on sn-devel-184
* pytdb: add python binding for storev()Jule Anger2020-05-051-0/+49
| | | | | | Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tdbtorture: Use ARRAY_DEL_ELEMENT()Volker Lendecke2020-03-261-2/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Mar 26 16:22:00 UTC 2020 on sn-devel-184
* py3: Remove #define PyInt_FromLong PyLong_FromLongAndrew Bartlett2020-03-231-6/+5
| | | | | | | 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-2/+1
| | | | | | | 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-2/+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>
* tdb: Align integer typesVolker Lendecke2020-01-231-2/+3
| | | | | | | | 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): Thu Jan 23 20:41:46 UTC 2020 on sn-devel-184
* tdb: Release tdb 1.4.3tdb-1.4.3Uri Simchoni2019-11-182-1/+74
| | | | | | | | | * Upgrade waf to version 2.0.18 to fix a cross-compilation issue. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/tdb/docs/tracing.txt: typo fixesBjörn Jacke2019-10-311-1/+1
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* tdb: Release tdb 1.4.2tdb-1.4.2Stefan Metzmacher2019-08-202-1/+74
| | | | | | | | | | | * Build fixes * Improve the performance by inlining the tdb_oob() checks Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Aug 20 14:45:41 UTC 2019 on sn-devel-184
* tdb: Inline the common part of tdb_oobVolker Lendecke2019-08-062-9/+15
| | | | | | | | | | | | | | When you set in tdbtorture.c to make it more similar to locking.tdb use, bin/tdbtorture -m -n 1 -l 100000 -s becomes twice as fast. This is a pretty extreme case, but all other tests that I did improve significantly as well. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Speed up tdb_oob()Volker Lendecke2019-08-062-1/+17
| | | | | | | | This is common between both implementations of tdb_oob(). It's faster if we don't have to dereference function pointers. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Introduce tdb_oob()Volker Lendecke2019-08-068-20/+26
| | | | | | | Initially just encapsulate the pointer dereferences Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Rename tdb_oob() to tdb_notrans_oob()Volker Lendecke2019-08-062-4/+4
| | | | | | | | tdb_oob() will become a public function encapsulating the pointer dereferences. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Adapt _tdb_transaction_cancel() to README.CodingVolker Lendecke2019-07-031-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* tdb: Adapt tdb_rescue() to README.CodingVolker Lendecke2019-07-031-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* lib tdb: memcmp ubsan warningGary Lockyer2019-07-011-5/+7
| | | | | | | | | | | | | | | | | Fix the ubsan warning lib/tdb/common/tdb.c:184:9: runtime error: null pointer passed as argument 2, which is declared to never be null" memcmp call now guarded by a length check. memcmp returns zero when called with a zero length parameter. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Mon Jul 1 14:50:54 UTC 2019 on sn-devel-184
* lib/tdb/common: Fix Array access results in a null pointer dereferenceNoel Power2019-07-011-1/+2
| | | | | | | | | | | | Fixes; lib/tdb/common/transaction.c:613:7: warning: Array access (via field 'blocks') results in a null pointer dereference <--[clang] if (tdb->transaction->blocks[i] != NULL) { ^ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* lib/tdb/common: Fix warning: Null pointer passed as argument to paramNoel Power2019-07-011-2/+4
| | | | | | | | | | | Fixes: lib/tdb/common/rescue.c:299:2: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] qsort(found.arr, found.num, sizeof(found.arr[0]), cmp_key); ^ ~~~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* clang: Fix Null pointer passed as argument warningNoel Power2019-06-261-1/+1
| | | | | | | | | | Fixes: lib/tdb/common/transaction.c:354:2: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] memcpy(tdb->transaction->blocks[blk] + off, buf, len); & Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* lib/tdb: clang: Fix warning: Dereference of null pointerNoel Power2019-06-261-0/+3
| | | | | | | | | | | Fixes: lib/tdb/common/lock.c:933:6: warning: Dereference of null pointer <--[clang] if (tdb->allrecord_lock.count) { ^~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* py3: Remove PyStr_FromFormat() compatability macroAndrew Bartlett2019-06-241-4/+1
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* py3: Remove PyStr_FromString() compatability macroAndrew Bartlett2019-06-241-3/+1
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* lib/tdb/common: clang: Fix 'Value stored to 'last_ptr' is never read'Noel Power2019-06-111-1/+0
| | | | | | | | | | | | | | Fixes lib/tdb/common/freelistcheck.c:96:3: warning: Value stored to 'last_ptr' is never read <--[clang] last_ptr = rec_ptr; ^ ~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer gary@catalyst.net.nz Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Tue Jun 11 13:31:01 UTC 2019 on sn-devel-184