The branch, 1.2.40 has been updated via 6e46fe96d46332cab6e8f9b6075c2f4ba6ceec04 (commit) via b0f28bc5a5b9ee8c878d797e10bd991750860776 (commit) from 2cf0ceb20c87756cf2e012d67129c0205c6db9aa (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.2.40 - Log ----------------------------------------------------------------- commit 6e46fe96d46332cab6e8f9b6075c2f4ba6ceec04 Author: Amitay Isaacs <ami...@gmail.com> Date: Mon Jun 17 13:19:39 2013 +1000 New version 1.2.63 Signed-off-by: Amitay Isaacs <ami...@gmail.com> commit b0f28bc5a5b9ee8c878d797e10bd991750860776 Author: Amitay Isaacs <ami...@gmail.com> Date: Thu Jun 13 12:52:38 2013 +1000 tdb: Update TDB library to 1.2.12 from upstream This comprises of following patches from Samba upstream. d1feccb35e987545f4ae8e3f4eb0b4fc741e7e7e tdb: change version to tdb-1.2.12 1f269fcc6e2bb46b765d547eb1add2bc52272c47 tdb: Add another overflow check to tdb_expand_adjust d9b4f19e73f241a1ccf64f04c3cc28d481550bb7 tdb: Make tdb_recovery_allocate overflow-safe 8b215df4454883b3733733af4f49f87eb0a2a46a tdb: Make tdb_recovery_size overflow-safe 7ae09a9695bcc5fad606441db3ab6e413b9d48ce tdb: add proper OOM/ENOSPC handling to tdb_expand() 854c5f0aac03c7c6d7e1b37997dcdc848fec1499 tdb: add overflow detection to tdb_expand_adjust() e19d46f7e31a32e2b5ae3ec05e13f32b8ac2109d tdb: add overflow/ENOSPC handling to tdb_expand_file() a07ba17e0c91d726416db946e6f65b064b2d17ec tdb: add a 'new_size' helper variable to tdb_expand_file() 4483bf143ddfee9ec07aed8f124559b00f757d9a tdb: Add overflow-checking tdb_add_off_t 3bd686c5ad4756af1033ac14ba09a40156cc6d47 tdb: fix logging of offets and lengths. cd4b413cb0574c459c1c24cf07f8d6b44f5fc077 build: Remove autoconf build system 11f467d0bd8e2264f311d82f3299443b99526bb3 tdb: include information about hash function being used in tdbtool info output c8c0bf74805c61b1379dab1d4529df0004872bb4 tdb: Fix blank line endings a92c08e18bca2f1db671dc5e2d0db4adbf39752d tdb: Little format change 68698b4e64831d2fdf762b5f8577ff404f10a3cb tdb: Slightly simplify tdb_expand_file 2f4b21bb57c4f96c5f5b57a69d022c142d8088d5 ntdb: switch between secrets.tdb and secrets.ntdb depending on 'use ntdb' a7fdd4f7c2e64eedf12cb46c3435edbec772a4ab tdb: Slightly simplify transaction_write fcb345f5d6be9659a0f8a5afe62a937010a33d5c tdb: Make tdb_release_transaction_locks use tdb_allrecord_unlock 5929e38b6cdbd4f9721293a19f079ceae1af76b0 tdb: Don't segfault if tdb_open_ex for check failed 3534e4e8d5bebfaaaef5886dcea219a7e4047fc7 tdb: Factor out the retry loop from tdb_allrecord_upgrade 1f93f0836484ccc1abe335f5bd2cfd35df0b7631 tdb: Simplify fcntl_lock() a bit 542400a966039178effd6c8da932ed3a8d749131 tdb: Use tdb_null in freelistcheck 68559b787e7c9a83e055493bde638ec02e1097d1 tdb: Enhance lock tracking a bit 05235d5b444558f6d06ef12ea7d74850800425cf tdb: Fix a typo 72cd5d5ff664dc46afb3dd6a5ea45a28ef7b8591 tdb: Remove "header" from tdb_context 71247ec4bdefb3a1b16619f7ea7404bcbafb5b60 tdb: Pass argument "header" to check_header_hash 1436107b0769c88e7eb50057b5f05ad5b8573990 tdb: Pass argument "header" to tdb_new_database 80a6fe84271d15cc22caa3d08768ab5559ef9ed7 Remove some unused variables. f2d67af7bc0b316f54d6cc1a44d07f1b24244378 tdb: Fix undefined prototype warnings 1beb4bc9d12fb124935e9e4710f48ad616dacc60 tdb: Fix \n in error messages a444bb95a270ca5b331041c11a7e785c1e0559b7 tdb: Add a comment explaining the "check" 3109b541c9b2f0063e1ccb0cdaec0a8e388b29b4 tdb: Make tdb_new_database() follow a more conventional style d972e6fa74b6499403d4c3d3c6a84cbda7eded39 tdb: Fix a typo c04de8f3a4deba0062f8cdbcbe74d3735a80b735 tdb: Fix a typo 24755d75b0ee7170195bc26cf28bab4ffdb6f752 tdb: Use tdb_lock_covered_by_allrecord_lock in tdb_unlock f8dafe5685008671f4f983a4defc90b4a05cf992 tdb: Factor out tdb_lock_covered_by_allrecord_lock from tdb_lock_list 26b8545df44df7e60ba0ba7336ffbdda8a14e423 tdb: Simplify logic in tdb_lock_list slightly 0f4e7a1401998746a6818b9469ab369d70418ac1 tdb: Slightly simplify tdb_lock_list 116ec13bb0718eb1de1ac1f4410d5c33f1db616f tdb: Fix blank line endings 7237fdd4ddc0b9c848b5936431b4f8731ce56dba tdb: Fix a comment d2b852d79bd83754d8952a0e3dece00e513549f2 tdb: Fix a typo 2c3fd8a13e7dde23a23404cd88078a04c8b338ea tdb: Fix a missing CONVERT c9053796b389758e8bacff4cd37d633fd65171f9 tdb: Improve the documentation of tdb_reopen() and tdb_close(). 7f08365a28770fdcc1bb625d8a16d11d8f15c29a tdb: Fix possible crash bugs in the python tdb code. ede2aaef281048123cacab9ae879f5c546787080 lib/tdb: Rename manpages/ to man/. 68c6dcb0942244f542eec7bbe5fba78ef7f66051 docs: man tdbtool: Add missing meta data. c62f8baff878001ead921112dd653ff69d1cfe7d tdb: Make tdb robust against improper CLEAR_IF_FIRST restart 37fd93194db10fc832ed3fa1ec880ebc26be904b tdb: Make robust against shrinking tdbs 100d38d6e0fae1dc666ae43941570c9f106b73c2 tdb: add -e option to tdbdump (and docment it). ffde8678910ae838588ab380b48a544333f81241 tdb: tdbdump should log errors, and fail in that case. 90f463b25f7bb0bc944732773c56e356834ea203 tdb: add tdb_rescue() a168a7c791a4be1730a370d059b3a1073fbb0bdd tdb: Fix a typo 1f50b6c3aefe9a7ac64641b1e9c23e014459647f tdb/test: fix build on OSF/1 41cffa3c8b126570203e32c2024d5a8f439b529e doc: Remove build/ from doxygen config or it will not work in brew. ea6b8ee026a4c53d9dfb5a42e4d9e485b89018e3 lib/tdb: Fix format string errors found by -Werror=format in tdb tests c92a5670e3d60decbc13bd8680de37184bc12815 pytdb: Check if the database is closed before we touch it a8e88332a394f4a4c3e43b496738008fba39d39f pytdb: Check for errors parsing strings into TDB_DATA 66f59f040984bef5023fc844097b85bebee88f09 tdb: finish weaning off err.h. 3c4263e7580143c69225729f5b67f09c00add2fd tdb: don't use err.h in tests. 1783fe34433f9bb4b939de3231a7c296390ec426 tdb: make TDB_NOSYNC merely disable sync. f7f6992c1e6ee8ac4a55c2fddf169ac695362036 autobuild: always set TDB_NO_FSYNC. bf5934ca1b80930d8fd2f19ef12e32092b34fa4d tdb/wscript: Remove unecessary semicolons. e2caba054f977b631720f8dc2528ba03dc237122 tdb: remove unused debug_fprintf() macro that breaks the build 0688cf102d2a513875d1832ad0de6052b837a72a tdb:tests: fix use of a non-existent word (existant) c8877d8f63ea367401fae4377cd28ee91b58d9e3 build: Remove unused release scripts for tdb 593e731097bc6f2fd50034f5e3ddac017894e584 lib/tdb: Update ABI 3fdeaa3992bb0599613e20d8e3248c478897531f lib/tdb: Add/expose lock functions to support CTDB 4442c0b2c92e4b2e88661e15022228c5f6547112 lib/tdb: fix transaction issue for HAVE_INCOHERENT_MMAP. c12970cc91cb4da8976801e194e29e33e02b340a lib/tdb: fix test/run-die-during-transaction when HAVE_INCOHERENT_MMAP. 330e3e1b91ecbf99af3b598b324f21b5eff933fd lib/tdb: fix missing return 0 code. fde694274e1e5a11d1473695e7ec7a97f95d39e4 lib/tdb: fix OpenBSD incoherent mmap. eafd83736918bc5953e4a91cf2d893e68f2da2a2 lib/tdb: fix up run-die-during-transaction test cases on Solaris. 3272ba0d2d63e6a7d00972bc2c052aee84f073fd lib/tdb: remove unnecessary XOPEN and FILE_OFFSET_BITS defines in test/ 583ffeae404cc632eebc43fed054391a59dffee2 lib/tdb: fix tests for standalone out-of-tree. 4d58d0fa8f936e7efdc02e31c053d42a47b3e62a tdb: build and run unit tests in tdb/test/ 205242e1769f96e0e8fccd52378965d35dd02093 tdb/test: fix up tests for use in SAMBA tdb code. 8fa345d952328c5866f3a0f835f3599343c51b00 tdb: wean CCAN-style unit tests off of tap. 0802791081ba39298aa93f0e6860c3b62800df73 tdb: import unit tests from CCAN into tdb/test/ 390b9a2dd8447ecd16e3957c02fa886781797733 tdb: make tdb_private.h idempotent. eff69aa0f908f5cb44b3cb846c8a4ada874240fa Add "repack" command to tdbtool. 7b42ceb414d3e14c411dd95dcd0b200113fe1191 Fix compile when TDB_TRACE is enabled. c1e9537ed0f58404fed96a7aa9e581b8ebb1fb60 tdb: Use tdb_parse_record in tdb_update_hash 5767224b7f4703c3195aa69eef4352d80980f95e tdb: don't free old recovery area when expanding if already at EOF. 3a2a755e3380a8f81374009d463cd06161352507 tdb: use same expansion factor logic when expanding for new recovery area. 664add17757836c5ee98618aef11371f412b6e44 tdb: Avoid a malloc/memcpy in _tdb_store b64494535dc62f4073fc6302847593ed6e6ec38b tdb: be more careful on 4G files. 20789bfdde37ee3140422b5599d41a280c01d29f tdb: Fix python documentation for tdb module 3741cf999e0f05a831d88330ac6bfa7ad34c2ec7 Remove unused variable. 3e6e1aed949a4483fc38607e443b5c8b715aca3b Fix a bunch of "warning: variable âXXXXâ set but not used [-Wunused-but-set-variable]" warnings from the new gcc. 86afe83d867229b11fd4ec9cb6e29af698cacdef waf: Factor checking for undefined symbol flags out into separate method. 3585abcd4cc1b6ffeeb7f64abe3d21a12f9633f6 pytdb: Shorter description which fits on a single line. 774f85649b5d9f8872ebfdd359964330b4ff436a tdb: Only check for pkg-config file when checking for system tdb. 31912781ca84db9b27264b5182729d1097c0661d wafsamba: Only install .pc files if libraries are public. a5025a3c2fa83c67e0a53611ad8fbe264888a590 tdb: Install pkg-config file. ee720fc19cebf9108711429dfe25ccaf192e2c7e tdb: increment sequence number in tdb_wipe_all(). e01f3108ff447239fb3cb2f89b4749c5f7b88c3b tdb: remove 'EOF' print from tdbrestore 5eecc854236f0b943aaa89e0c3a46f9fbd208ca9 tdb2: create tdb2 versions of various testing TDBs. 6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420 tdb_store: check returns for 0, not -1. 4fa51257b283c2e8bb415cc7f9c001d64c8a2669 tdb: enable VALGRIND to remove valgrind noise. 43ab5aa390769ee9b57918cf5b57aa4a22586805 lib/tdb/python/tests/simple.py: don't assume TDB ordering. 73c31f044e32103276558a194698ea6cf876b4f2 tdb: fix a build warning. bf3b2e2aee284c85ecea6a3142bc1fa5344b430a Support the 'PYTHON' environment variable. 1804d9a64662d37f6c7c50bdd7b8edd80f42192b tdb_backup: avoid transaction on backup file, use lockall 36cfa7b79e36d880cdbf24d0769558be44d0edda tdb: make sure we skip over recovery area correctly. cb884186a55c9ef8aca6ee48b16423b3c881e689 tdb_expand: limit the expansion with huge records 094ab60053bcc0bc3542af8144e394d83270053e tdb: tdb_repack() only when it's worthwhile. 6aa72dae8fc341de5b497f831ded1f8f519fa8fb tdb: fix transaction recovery area for converted tdbs. 0080f944b47f3afa676153e5da7093a8667fc005 tdb: Fix Coverity ID 2238: SECURE_CODING 25397de589e577e32bb291576b10c18978b5bc4e tdb: Fix Coverity ID 2192: NO_EFFECT bfce962c8f5219e72a07810a663a14542355927d tdb: rename convert_string() to tdb_convert_string() c56e3ccfc9eafbb69b03dc40346e3115bec42ef6 lib: don't install public headers if a private library 7b948a39e1783ff4732f9734830b0544d6a814b1 tdb: use public_headers to install header files 0a0ebd73fb98002f099544eca5deaf6763790277 tdb: use system include style for system headers 949427c208159f4ac580f547dd5465a70b4751b7 python: use os.environ[] instead of os.putenv() 91cad71390bd2a0330891083c65d3f9000b74657 tdb: Fix a C++ warning 8b8caac6d0ac980e59bc5bcbfb06502deebb9f42 build: removed the old autogen.sh and autogen-waf.sh scripts b42afa0edf375c944d39a888f4db422e8d2b13cf tdb: Added doxygen documentation. 005c6370cdaab69d4228ecbf5e7369ebc61b86ae waf: ensure "make dist" works from a clean git tree for all libraries 24d5a7202ab521b92eb07c93647ae2d381e181a5 tdbrestore: Update to GPLv3+, remove old FSF address. 5792fa90ace06f736661d9924ec9a75c3a0a9771 s4-python: Only set BASETYPE flag if subclassing is supported. 51239bb26a714bf4c41fb15fde211df1255f9468 talloc/tdb/tevent: Remove obsolete signatures files. b222615b5978aa78e82af79359b7cc3baec0bc87 tdb: add ABI/tdb-1.2.9.sigs cac57328a6077dc428396402036636095f139569 tdb: tdb_summary() support. 7ea1b767977c8c201c0f5bfaeb01f96af4b51f7b tdb: setup TEST_DATA_PREFIX for make test b83672b36c1ea8c35833c40c3919b63809f16624 tdb:tdbtorture: use TEST_DATA_PREFIX for files d81ceeb9833ec80d7ab21b34e4b3af3d79aeb845 tdb:tdbtest: use TEST_DATA_PREFIX for files 9e8a04984327ffae611165244a159ff9c6ca30f4 tdb: Remove autotools support. 46ee6908be64c4405b3a8f7477abc119aa060020 tdb: add ABI/tdb-1.2.8.sigs c754fad5712cc7c1912f27eb5595c12cf65e55c6 tdb: Bump version number after symbol versioning changes. 51e7244269e9c14a920f91a485cda6c785b2fc85 pytdb: Make PyTdb variable static. 87337383572324e3d1d00ed710614ebe217aa2b2 build: introduce SAMBA_CHECK_PYTHON_HEADERS 57f2f1d72a70a80e61a2ed6f1abc63a177a590ab waf: remove the restriction that private libraries must not have a vnum ebe2867fc2c01fb5288d62eedb0e2f43788b9f27 waf-abi: auto-generate per-symbol versions from ABI files 735c1cd2da15167748e92ba6de48fdb5169db587 s4-pkgconfig: add @LIB_RPATH@ to our link flags 989d8803f28826e6541667127abad801c4fa4566 tdb:common/open.c - use "discard_const_p" for certain "tdb->name" assignments d2560cd7dc106d7853442133f237001f68bcb971 tdb:tdbstore.c - remove an useless '\' 2ac5cedb719d220db412d0bdc69e34bad9ab26f1 Avoid the use of PyAPI_DATA, which is for internal Python API's. dedd064aa825edd57f992b12218a184398db9586 tdb: set tdb->name early, as it's needed for tdb_name() f0a472a2d678dd0374181f1a6ac0a3d35503636e waf: added reconfigure targets to our libraries 1aa8308c30962ac04a2997acaa7f2a7458729cc2 tdb: Use waf by default. 3deece559159150a0710d8160f39583ba7f2e582 s4: Remove the old perl/m4/make/mk-based build system. 50256c01d061c6d73bb2d8ee2c60785d58748e6c waf: Only specify vnum for non-private libraries. 49ef2888193dd7cc37c3fe0a980b7cc1abdac805 waf: Rename some BUNDLED_ functios to PRIVATE_. dec00bf0974ea3b5079c32e2a6e6253954297253 tdb: Revert re-addition of tdb_set_logging_function. ee913f45683e66d4391944e034217a56d42e7ab5 tdb: commit the version 1.2.7 signatures c529317fe2b48e045b35a613cfd1ad3f03b68435 Lowercase socket_wrapper name. 62c4af99428abb2d4ac1b18454d72e0c8cbb67e8 tdb: Set _PUBLIC_ in C file rather than header files (Debian bug 600898) 7cba3cfac8781061e4114573517b30baedbf891a waf: replace the is_bundled option with private_library 713900b81297548c44a890c3bca1dde9019af8bc s4-build: fixed some formatting 05c1beb6b47e607dac9850e81cef775a1d9b00ae tdb: Bump version to 1.2.7 after addition of pytdb.__version__. bb0017615d44b66828c98a408ca15b50956f3e91 waf: fixed exit status of test suites 20d39691a8eecd57b27cb709a70c50bf572b8114 tdb: Only use system pytdb when using system tdb. e805bf52c9ed32bd53759996b5700c5d582a2a58 tdb: Support using system pytdb. Signed-off-by: Amitay Isaacs <ami...@gmail.com> ----------------------------------------------------------------------- Summary of changes: lib/tdb/ABI/tdb-1.2.1.sigs | 95 +++ lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.10.sigs} | 5 + lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.11.sigs} | 6 + lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.12.sigs} | 6 + lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.2.sigs} | 1 - lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.3.sigs} | 1 - lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.4.sigs} | 1 - lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.5.sigs} | 0 lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.7.sigs} | 0 lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.8.sigs} | 0 lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.9.sigs} | 1 + lib/tdb/common/check.c | 56 +- lib/tdb/common/dump.c | 21 +- lib/tdb/common/error.c | 6 +- lib/tdb/common/freelist.c | 38 +- lib/tdb/common/freelistcheck.c | 9 +- lib/tdb/common/hash.c | 38 +- lib/tdb/common/io.c | 298 +++++-- lib/tdb/common/lock.c | 225 +++--- lib/tdb/common/open.c | 159 +++- lib/tdb/common/rescue.c | 349 ++++++++ lib/tdb/common/summary.c | 203 +++++ lib/tdb/common/tdb.c | 142 ++-- lib/tdb/common/tdb_private.h | 25 +- lib/tdb/common/transaction.c | 311 +++++--- lib/tdb/common/traverse.c | 24 +- lib/tdb/configure.ac | 2 +- lib/tdb/docs/mainpage.dox | 61 ++ lib/{talloc => tdb}/doxy.config | 321 ++++++-- lib/tdb/include/tdb.h | 880 +++++++++++++++++--- lib/tdb/man/tdbbackup.8.xml | 141 ++++ lib/tdb/man/tdbdump.8.xml | 92 ++ lib/tdb/man/tdbrestore.8.xml | 66 ++ lib/tdb/man/tdbtool.8.xml | 235 ++++++ lib/tdb/pytdb.c | 137 +++- lib/tdb/python/tests/simple.py | 77 ++- lib/tdb/tdb.pc.in | 2 +- lib/tdb/test/external-agent.c | 198 +++++ lib/tdb/test/external-agent.h | 41 + lib/tdb/test/jenkins-be-hash.tdb | Bin 0 -> 696 bytes lib/tdb/test/jenkins-le-hash.tdb | Bin 0 -> 696 bytes lib/tdb/test/lock-tracking.c | 157 ++++ lib/tdb/test/lock-tracking.h | 25 + lib/tdb/test/logging.c | 33 + lib/tdb/test/logging.h | 11 + lib/tdb/test/old-nohash-be.tdb | Bin 0 -> 696 bytes lib/tdb/test/old-nohash-le.tdb | Bin 0 -> 696 bytes lib/tdb/test/run-3G-file.c | 144 ++++ lib/tdb/test/run-bad-tdb-header.c | 58 ++ lib/tdb/test/run-check.c | 64 ++ lib/tdb/test/run-corrupt.c | 131 +++ lib/tdb/test/run-die-during-transaction.c | 231 +++++ lib/tdb/test/run-endian.c | 63 ++ lib/tdb/test/run-incompatible.c | 185 ++++ lib/tdb/test/run-nested-transactions.c | 78 ++ lib/tdb/test/run-nested-traverse.c | 87 ++ lib/tdb/test/run-no-lock-during-traverse.c | 113 +++ lib/tdb/test/run-oldhash.c | 49 ++ lib/tdb/test/run-open-during-transaction.c | 181 ++++ lib/tdb/test/run-readonly-check.c | 52 ++ lib/tdb/test/run-rescue-find_entry.c | 50 ++ lib/tdb/test/run-rescue.c | 126 +++ lib/tdb/test/run-rwlock-check.c | 45 + lib/tdb/test/run-summary.c | 64 ++ lib/tdb/test/run-transaction-expand.c | 119 +++ lib/tdb/test/run-traverse-in-transaction.c | 86 ++ lib/tdb/test/run-wronghash-fail.c | 120 +++ lib/tdb/test/run-zero-append.c | 40 + lib/tdb/test/run.c | 49 ++ lib/tdb/test/rwlock-be.tdb | Bin 0 -> 696 bytes lib/tdb/test/rwlock-le.tdb | Bin 0 -> 696 bytes .../testsuite_main.c => tdb/test/tap-interface.h} | 40 +- lib/tdb/test/tap-to-subunit.h | 155 ++++ lib/tdb/test/tdb.corrupt | Bin 0 -> 192512 bytes lib/tdb/tools/tdbbackup.c | 48 +- lib/tdb/tools/tdbdump.c | 70 ++- lib/tdb/tools/tdbrestore.c | 12 +- lib/tdb/tools/tdbtest.c | 43 +- lib/tdb/tools/tdbtool.c | 84 +- lib/tdb/tools/tdbtorture.c | 47 +- lib/tdb/wscript | 224 +++++ packaging/RPM/ctdb.spec.in | 4 +- 82 files changed, 6488 insertions(+), 873 deletions(-) create mode 100644 lib/tdb/ABI/tdb-1.2.1.sigs copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.10.sigs} (92%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.11.sigs} (90%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.12.sigs} (90%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.2.sigs} (98%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.3.sigs} (98%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.4.sigs} (98%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.5.sigs} (100%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.7.sigs} (100%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.8.sigs} (100%) copy lib/tdb/ABI/{tdb-1.2.6.sigs => tdb-1.2.9.sigs} (98%) create mode 100644 lib/tdb/common/rescue.c create mode 100644 lib/tdb/common/summary.c create mode 100644 lib/tdb/docs/mainpage.dox copy lib/{talloc => tdb}/doxy.config (83%) create mode 100644 lib/tdb/man/tdbbackup.8.xml create mode 100644 lib/tdb/man/tdbdump.8.xml create mode 100644 lib/tdb/man/tdbrestore.8.xml create mode 100644 lib/tdb/man/tdbtool.8.xml create mode 100644 lib/tdb/test/external-agent.c create mode 100644 lib/tdb/test/external-agent.h create mode 100644 lib/tdb/test/jenkins-be-hash.tdb create mode 100644 lib/tdb/test/jenkins-le-hash.tdb create mode 100644 lib/tdb/test/lock-tracking.c create mode 100644 lib/tdb/test/lock-tracking.h create mode 100644 lib/tdb/test/logging.c create mode 100644 lib/tdb/test/logging.h create mode 100644 lib/tdb/test/old-nohash-be.tdb create mode 100644 lib/tdb/test/old-nohash-le.tdb create mode 100644 lib/tdb/test/run-3G-file.c create mode 100644 lib/tdb/test/run-bad-tdb-header.c create mode 100644 lib/tdb/test/run-check.c create mode 100644 lib/tdb/test/run-corrupt.c create mode 100644 lib/tdb/test/run-die-during-transaction.c create mode 100644 lib/tdb/test/run-endian.c create mode 100644 lib/tdb/test/run-incompatible.c create mode 100644 lib/tdb/test/run-nested-transactions.c create mode 100644 lib/tdb/test/run-nested-traverse.c create mode 100644 lib/tdb/test/run-no-lock-during-traverse.c create mode 100644 lib/tdb/test/run-oldhash.c create mode 100644 lib/tdb/test/run-open-during-transaction.c create mode 100644 lib/tdb/test/run-readonly-check.c create mode 100644 lib/tdb/test/run-rescue-find_entry.c create mode 100644 lib/tdb/test/run-rescue.c create mode 100644 lib/tdb/test/run-rwlock-check.c create mode 100644 lib/tdb/test/run-summary.c create mode 100644 lib/tdb/test/run-transaction-expand.c create mode 100644 lib/tdb/test/run-traverse-in-transaction.c create mode 100644 lib/tdb/test/run-wronghash-fail.c create mode 100644 lib/tdb/test/run-zero-append.c create mode 100644 lib/tdb/test/run.c create mode 100644 lib/tdb/test/rwlock-be.tdb create mode 100644 lib/tdb/test/rwlock-le.tdb copy lib/{talloc/testsuite_main.c => tdb/test/tap-interface.h} (55%) create mode 100644 lib/tdb/test/tap-to-subunit.h create mode 100644 lib/tdb/test/tdb.corrupt create mode 100644 lib/tdb/wscript Changeset truncated at 500 lines: diff --git a/lib/tdb/ABI/tdb-1.2.1.sigs b/lib/tdb/ABI/tdb-1.2.1.sigs new file mode 100644 index 0000000..84f2007 --- /dev/null +++ b/lib/tdb/ABI/tdb-1.2.1.sigs @@ -0,0 +1,95 @@ +tdb_add_flags: void (struct tdb_context *, unsigned int) +tdb_alloc_read: unsigned char *(struct tdb_context *, tdb_off_t, tdb_len_t) +tdb_allocate: tdb_off_t (struct tdb_context *, tdb_len_t, struct tdb_record *) +tdb_allrecord_lock: int (struct tdb_context *, int, enum tdb_lock_flags, bool) +tdb_allrecord_unlock: int (struct tdb_context *, int, bool) +tdb_allrecord_upgrade: int (struct tdb_context *) +tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA) +tdb_brlock: int (struct tdb_context *, int, tdb_off_t, size_t, enum tdb_lock_flags) +tdb_brunlock: int (struct tdb_context *, int, tdb_off_t, size_t) +tdb_chainlock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA) +tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_close: int (struct tdb_context *) +tdb_convert: void *(void *, uint32_t) +tdb_delete: int (struct tdb_context *, TDB_DATA) +tdb_do_delete: int (struct tdb_context *, tdb_off_t, struct tdb_record *) +tdb_dump_all: void (struct tdb_context *) +tdb_enable_seqnum: void (struct tdb_context *) +tdb_error: enum TDB_ERROR (struct tdb_context *) +tdb_errorstr: const char *(struct tdb_context *) +tdb_exists: int (struct tdb_context *, TDB_DATA) +tdb_expand: int (struct tdb_context *, tdb_off_t) +tdb_fd: int (struct tdb_context *) +tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_find_lock_hash: tdb_off_t (struct tdb_context *, TDB_DATA, uint32_t, int, struct tdb_record *) +tdb_firstkey: TDB_DATA (struct tdb_context *) +tdb_free: int (struct tdb_context *, tdb_off_t, struct tdb_record *) +tdb_freelist_size: int (struct tdb_context *) +tdb_get_flags: int (struct tdb_context *) +tdb_get_logging_private: void *(struct tdb_context *) +tdb_get_seqnum: int (struct tdb_context *) +tdb_hash_size: int (struct tdb_context *) +tdb_have_extra_locks: bool (struct tdb_context *) +tdb_increment_seqnum_nonblock: void (struct tdb_context *) +tdb_io_init: void (struct tdb_context *) +tdb_lock: int (struct tdb_context *, int, int) +tdb_lock_nonblock: int (struct tdb_context *, int, int) +tdb_lock_record: int (struct tdb_context *, tdb_off_t) +tdb_lockall: int (struct tdb_context *) +tdb_lockall_mark: int (struct tdb_context *) +tdb_lockall_nonblock: int (struct tdb_context *) +tdb_lockall_read: int (struct tdb_context *) +tdb_lockall_read_nonblock: int (struct tdb_context *) +tdb_lockall_unmark: int (struct tdb_context *) +tdb_log_fn: tdb_log_func (struct tdb_context *) +tdb_map_size: size_t (struct tdb_context *) +tdb_mmap: void (struct tdb_context *) +tdb_munmap: int (struct tdb_context *) +tdb_name: const char *(struct tdb_context *) +tdb_needs_recovery: bool (struct tdb_context *) +tdb_nest_lock: int (struct tdb_context *, uint32_t, int, enum tdb_lock_flags) +tdb_nest_unlock: int (struct tdb_context *, uint32_t, int, bool) +tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_ofs_read: int (struct tdb_context *, tdb_off_t, tdb_off_t *) +tdb_ofs_write: int (struct tdb_context *, tdb_off_t, tdb_off_t *) +tdb_open: struct tdb_context *(const char *, int, int, int, mode_t) +tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func) +tdb_parse_data: int (struct tdb_context *, TDB_DATA, tdb_off_t, tdb_len_t, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_printfreelist: int (struct tdb_context *) +tdb_rec_free_read: int (struct tdb_context *, tdb_off_t, struct tdb_record *) +tdb_rec_read: int (struct tdb_context *, tdb_off_t, struct tdb_record *) +tdb_rec_write: int (struct tdb_context *, tdb_off_t, struct tdb_record *) +tdb_release_transaction_locks: void (struct tdb_context *) +tdb_remove_flags: void (struct tdb_context *, unsigned int) +tdb_reopen: int (struct tdb_context *) +tdb_reopen_all: int (int) +tdb_repack: int (struct tdb_context *) +tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) +tdb_set_max_dead: void (struct tdb_context *, int) +tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) +tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_transaction_cancel: int (struct tdb_context *) +tdb_transaction_commit: int (struct tdb_context *) +tdb_transaction_lock: int (struct tdb_context *, int, enum tdb_lock_flags) +tdb_transaction_prepare_commit: int (struct tdb_context *) +tdb_transaction_recover: int (struct tdb_context *) +tdb_transaction_start: int (struct tdb_context *) +tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_unlock: int (struct tdb_context *, int) +tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) +tdb_unlock_record: int (struct tdb_context *, tdb_off_t) +tdb_unlockall: int (struct tdb_context *) +tdb_unlockall_read: int (struct tdb_context *) +tdb_validate_freelist: int (struct tdb_context *, int *) +tdb_wipe_all: int (struct tdb_context *) +tdb_write_lock_record: int (struct tdb_context *, tdb_off_t) +tdb_write_unlock_record: int (struct tdb_context *, tdb_off_t) diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.10.sigs similarity index 92% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.10.sigs index 1e01f3b..61f6c19 100644 --- a/lib/tdb/ABI/tdb-1.2.6.sigs +++ b/lib/tdb/ABI/tdb-1.2.10.sigs @@ -25,6 +25,7 @@ tdb_get_seqnum: int (struct tdb_context *) tdb_hash_size: int (struct tdb_context *) tdb_increment_seqnum_nonblock: void (struct tdb_context *) tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) tdb_lockall: int (struct tdb_context *) tdb_lockall_mark: int (struct tdb_context *) tdb_lockall_nonblock: int (struct tdb_context *) @@ -48,13 +49,17 @@ tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_c tdb_set_max_dead: void (struct tdb_context *, int) tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_summary: char *(struct tdb_context *) tdb_transaction_cancel: int (struct tdb_context *) tdb_transaction_commit: int (struct tdb_context *) tdb_transaction_prepare_commit: int (struct tdb_context *) tdb_transaction_start: int (struct tdb_context *) tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) tdb_unlockall: int (struct tdb_context *) tdb_unlockall_read: int (struct tdb_context *) tdb_validate_freelist: int (struct tdb_context *, int *) diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.11.sigs similarity index 90% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.11.sigs index 1e01f3b..d727f21 100644 --- a/lib/tdb/ABI/tdb-1.2.6.sigs +++ b/lib/tdb/ABI/tdb-1.2.11.sigs @@ -25,6 +25,7 @@ tdb_get_seqnum: int (struct tdb_context *) tdb_hash_size: int (struct tdb_context *) tdb_increment_seqnum_nonblock: void (struct tdb_context *) tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) tdb_lockall: int (struct tdb_context *) tdb_lockall_mark: int (struct tdb_context *) tdb_lockall_nonblock: int (struct tdb_context *) @@ -44,17 +45,22 @@ tdb_remove_flags: void (struct tdb_context *, unsigned int) tdb_reopen: int (struct tdb_context *) tdb_reopen_all: int (int) tdb_repack: int (struct tdb_context *) +tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), void *) tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) tdb_set_max_dead: void (struct tdb_context *, int) tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_summary: char *(struct tdb_context *) tdb_transaction_cancel: int (struct tdb_context *) tdb_transaction_commit: int (struct tdb_context *) tdb_transaction_prepare_commit: int (struct tdb_context *) tdb_transaction_start: int (struct tdb_context *) tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) tdb_unlockall: int (struct tdb_context *) tdb_unlockall_read: int (struct tdb_context *) tdb_validate_freelist: int (struct tdb_context *, int *) diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.12.sigs similarity index 90% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.12.sigs index 1e01f3b..d727f21 100644 --- a/lib/tdb/ABI/tdb-1.2.6.sigs +++ b/lib/tdb/ABI/tdb-1.2.12.sigs @@ -25,6 +25,7 @@ tdb_get_seqnum: int (struct tdb_context *) tdb_hash_size: int (struct tdb_context *) tdb_increment_seqnum_nonblock: void (struct tdb_context *) tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) tdb_lockall: int (struct tdb_context *) tdb_lockall_mark: int (struct tdb_context *) tdb_lockall_nonblock: int (struct tdb_context *) @@ -44,17 +45,22 @@ tdb_remove_flags: void (struct tdb_context *, unsigned int) tdb_reopen: int (struct tdb_context *) tdb_reopen_all: int (int) tdb_repack: int (struct tdb_context *) +tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), void *) tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) tdb_set_max_dead: void (struct tdb_context *, int) tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_summary: char *(struct tdb_context *) tdb_transaction_cancel: int (struct tdb_context *) tdb_transaction_commit: int (struct tdb_context *) tdb_transaction_prepare_commit: int (struct tdb_context *) tdb_transaction_start: int (struct tdb_context *) tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) tdb_unlockall: int (struct tdb_context *) tdb_unlockall_read: int (struct tdb_context *) tdb_validate_freelist: int (struct tdb_context *, int *) diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.2.sigs similarity index 98% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.2.sigs index 1e01f3b..043790d 100644 --- a/lib/tdb/ABI/tdb-1.2.6.sigs +++ b/lib/tdb/ABI/tdb-1.2.2.sigs @@ -24,7 +24,6 @@ tdb_get_logging_private: void *(struct tdb_context *) tdb_get_seqnum: int (struct tdb_context *) tdb_hash_size: int (struct tdb_context *) tdb_increment_seqnum_nonblock: void (struct tdb_context *) -tdb_jenkins_hash: unsigned int (TDB_DATA *) tdb_lockall: int (struct tdb_context *) tdb_lockall_mark: int (struct tdb_context *) tdb_lockall_nonblock: int (struct tdb_context *) diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.3.sigs similarity index 98% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.3.sigs index 1e01f3b..043790d 100644 --- a/lib/tdb/ABI/tdb-1.2.6.sigs +++ b/lib/tdb/ABI/tdb-1.2.3.sigs @@ -24,7 +24,6 @@ tdb_get_logging_private: void *(struct tdb_context *) tdb_get_seqnum: int (struct tdb_context *) tdb_hash_size: int (struct tdb_context *) tdb_increment_seqnum_nonblock: void (struct tdb_context *) -tdb_jenkins_hash: unsigned int (TDB_DATA *) tdb_lockall: int (struct tdb_context *) tdb_lockall_mark: int (struct tdb_context *) tdb_lockall_nonblock: int (struct tdb_context *) diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.4.sigs similarity index 98% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.4.sigs index 1e01f3b..043790d 100644 --- a/lib/tdb/ABI/tdb-1.2.6.sigs +++ b/lib/tdb/ABI/tdb-1.2.4.sigs @@ -24,7 +24,6 @@ tdb_get_logging_private: void *(struct tdb_context *) tdb_get_seqnum: int (struct tdb_context *) tdb_hash_size: int (struct tdb_context *) tdb_increment_seqnum_nonblock: void (struct tdb_context *) -tdb_jenkins_hash: unsigned int (TDB_DATA *) tdb_lockall: int (struct tdb_context *) tdb_lockall_mark: int (struct tdb_context *) tdb_lockall_nonblock: int (struct tdb_context *) diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.5.sigs similarity index 100% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.5.sigs diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.7.sigs similarity index 100% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.7.sigs diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.8.sigs similarity index 100% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.8.sigs diff --git a/lib/tdb/ABI/tdb-1.2.6.sigs b/lib/tdb/ABI/tdb-1.2.9.sigs similarity index 98% copy from lib/tdb/ABI/tdb-1.2.6.sigs copy to lib/tdb/ABI/tdb-1.2.9.sigs index 1e01f3b..9e4149b 100644 --- a/lib/tdb/ABI/tdb-1.2.6.sigs +++ b/lib/tdb/ABI/tdb-1.2.9.sigs @@ -48,6 +48,7 @@ tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_c tdb_set_max_dead: void (struct tdb_context *, int) tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_summary: char *(struct tdb_context *) tdb_transaction_cancel: int (struct tdb_context *) tdb_transaction_commit: int (struct tdb_context *) tdb_transaction_prepare_commit: int (struct tdb_context *) diff --git a/lib/tdb/common/check.c b/lib/tdb/common/check.c index 58c9c26..9f9d870 100644 --- a/lib/tdb/common/check.c +++ b/lib/tdb/common/check.c @@ -50,11 +50,11 @@ static bool tdb_check_header(struct tdb_context *tdb, tdb_off_t *recovery) if (hdr.hash_size == 0) goto corrupt; - if (hdr.hash_size != tdb->header.hash_size) + if (hdr.hash_size != tdb->hash_size) goto corrupt; if (hdr.recovery_start != 0 && - hdr.recovery_start < TDB_DATA_START(tdb->header.hash_size)) + hdr.recovery_start < TDB_DATA_START(tdb->hash_size)) goto corrupt; *recovery = hdr.recovery_start; @@ -74,43 +74,43 @@ static bool tdb_check_record(struct tdb_context *tdb, tdb_off_t tailer; /* Check rec->next: 0 or points to record offset, aligned. */ - if (rec->next > 0 && rec->next < TDB_DATA_START(tdb->header.hash_size)){ + if (rec->next > 0 && rec->next < TDB_DATA_START(tdb->hash_size)){ TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d too small next %d\n", + "Record offset %u too small next %u\n", off, rec->next)); goto corrupt; } if (rec->next + sizeof(*rec) < rec->next) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d too large next %d\n", + "Record offset %u too large next %u\n", off, rec->next)); goto corrupt; } if ((rec->next % TDB_ALIGNMENT) != 0) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d misaligned next %d\n", + "Record offset %u misaligned next %u\n", off, rec->next)); goto corrupt; } - if (tdb->methods->tdb_oob(tdb, rec->next+sizeof(*rec), 0)) + if (tdb->methods->tdb_oob(tdb, rec->next, sizeof(*rec), 0)) goto corrupt; /* Check rec_len: similar to rec->next, implies next record. */ if ((rec->rec_len % TDB_ALIGNMENT) != 0) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d misaligned length %d\n", + "Record offset %u misaligned length %u\n", off, rec->rec_len)); goto corrupt; } /* Must fit tailer. */ if (rec->rec_len < sizeof(tailer)) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d too short length %d\n", + "Record offset %u too short length %u\n", off, rec->rec_len)); goto corrupt; } /* OOB allows "right at the end" access, so this works for last rec. */ - if (tdb->methods->tdb_oob(tdb, off+sizeof(*rec)+rec->rec_len, 0)) + if (tdb->methods->tdb_oob(tdb, off, sizeof(*rec)+rec->rec_len, 0)) goto corrupt; /* Check tailer. */ @@ -119,7 +119,7 @@ static bool tdb_check_record(struct tdb_context *tdb, goto corrupt; if (tailer != sizeof(*rec) + rec->rec_len) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d invalid tailer\n", off)); + "Record offset %u invalid tailer\n", off)); goto corrupt; } @@ -247,7 +247,7 @@ static bool tdb_check_used_record(struct tdb_context *tdb, /* key + data + tailer must fit in record */ if (rec->key_len + rec->data_len + sizeof(tdb_off_t) > rec->rec_len) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d too short for contents\n", off)); + "Record offset %u too short for contents\n", off)); return false; } @@ -257,7 +257,7 @@ static bool tdb_check_used_record(struct tdb_context *tdb, if (tdb->hash_fn(&key) != rec->full_hash) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Record offset %d has incorrect hash\n", off)); + "Record offset %u has incorrect hash\n", off)); goto fail_put_key; } @@ -308,7 +308,7 @@ static bool tdb_check_free_record(struct tdb_context *tdb, } /* Slow, but should be very rare. */ -static size_t dead_space(struct tdb_context *tdb, tdb_off_t off) +size_t tdb_dead_space(struct tdb_context *tdb, tdb_off_t off) { size_t len; @@ -322,7 +322,7 @@ static size_t dead_space(struct tdb_context *tdb, tdb_off_t off) return len; } -int tdb_check(struct tdb_context *tdb, +_PUBLIC_ int tdb_check(struct tdb_context *tdb, int (*check)(TDB_DATA key, TDB_DATA data, void *private_data), void *private_data) { @@ -345,14 +345,14 @@ int tdb_check(struct tdb_context *tdb, } /* Make sure we know true size of the underlying file. */ - tdb->methods->tdb_oob(tdb, tdb->map_size + 1, 1); + tdb->methods->tdb_oob(tdb, tdb->map_size, 1, 1); /* Header must be OK: also gets us the recovery ptr, if any. */ if (!tdb_check_header(tdb, &recovery_start)) goto unlock; /* We should have the whole header, too. */ - if (tdb->map_size < TDB_DATA_START(tdb->header.hash_size)) { + if (tdb->map_size < TDB_DATA_START(tdb->hash_size)) { tdb->ecode = TDB_ERR_CORRUPT; TDB_LOG((tdb, TDB_DEBUG_ERROR, "File too short for hashes\n")); goto unlock; @@ -360,20 +360,20 @@ int tdb_check(struct tdb_context *tdb, /* One big malloc: pointers then bit arrays. */ hashes = (unsigned char **)calloc( - 1, sizeof(hashes[0]) * (1+tdb->header.hash_size) - + BITMAP_BITS / CHAR_BIT * (1+tdb->header.hash_size)); + 1, sizeof(hashes[0]) * (1+tdb->hash_size) + + BITMAP_BITS / CHAR_BIT * (1+tdb->hash_size)); if (!hashes) { tdb->ecode = TDB_ERR_OOM; goto unlock; } /* Initialize pointers */ - hashes[0] = (unsigned char *)(&hashes[1+tdb->header.hash_size]); - for (h = 1; h < 1+tdb->header.hash_size; h++) + hashes[0] = (unsigned char *)(&hashes[1+tdb->hash_size]); + for (h = 1; h < 1+tdb->hash_size; h++) hashes[h] = hashes[h-1] + BITMAP_BITS / CHAR_BIT; /* Freelist and hash headers are all in a row: read them. */ - for (h = 0; h < 1+tdb->header.hash_size; h++) { + for (h = 0; h < 1+tdb->hash_size; h++) { if (tdb_ofs_read(tdb, FREELIST_TOP + h*sizeof(tdb_off_t), &off) == -1) goto free; @@ -382,7 +382,7 @@ int tdb_check(struct tdb_context *tdb, } /* For each record, read it in and check it's ok. */ - for (off = TDB_DATA_START(tdb->header.hash_size); + for (off = TDB_DATA_START(tdb->hash_size); off < tdb->map_size; off += sizeof(rec) + rec.rec_len) { if (tdb->methods->tdb_read(tdb, off, &rec, sizeof(rec), @@ -406,19 +406,19 @@ int tdb_check(struct tdb_context *tdb, found_recovery = true; break; } - dead = dead_space(tdb, off); + dead = tdb_dead_space(tdb, off); if (dead < sizeof(rec)) goto corrupt; TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Dead space at %d-%d (of %u)\n", + "Dead space at %u-%u (of %u)\n", off, off + dead, tdb->map_size)); rec.rec_len = dead - sizeof(rec); break; case TDB_RECOVERY_MAGIC: if (recovery_start != off) { TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Unexpected recovery record at offset %d\n", + "Unexpected recovery record at offset %u\n", off)); goto free; } @@ -428,7 +428,7 @@ int tdb_check(struct tdb_context *tdb, corrupt: tdb->ecode = TDB_ERR_CORRUPT; TDB_LOG((tdb, TDB_DEBUG_ERROR, - "Bad magic 0x%x at offset %d\n", + "Bad magic 0x%x at offset %u\n", rec.magic, off)); goto free; } @@ -436,7 +436,7 @@ int tdb_check(struct tdb_context *tdb, /* Now, hashes should all be empty: each record exists and is referred * to by one other. */ - for (h = 0; h < 1+tdb->header.hash_size; h++) { + for (h = 0; h < 1+tdb->hash_size; h++) { unsigned int i; for (i = 0; i < BITMAP_BITS / CHAR_BIT; i++) { if (hashes[h][i] != 0) { diff --git a/lib/tdb/common/dump.c b/lib/tdb/common/dump.c index 9f770f8..7193c1e 100644 --- a/lib/tdb/common/dump.c +++ b/lib/tdb/common/dump.c @@ -1,4 +1,4 @@ - /* + /* Unix SMB/CIFS implementation. trivial database library -- CTDB repository