summaryrefslogtreecommitdiff
path: root/source/lib/util_tdb.c
Commit message (Collapse)AuthorAgeFilesLines
* util_tdb: fix a segfault caused by a fatal typo.Michael Adam2008-04-121-1/+1
| | | | | | | | | In tdb_wrap_log(), in on occurrence of "debug_level = 0" instead of "debuglevel = 0" caused me segfaults when accessing DEBUGLEVEL (which is defined as "*debug_level"...) Michael (cherry picked from commit d9bd894c2ec4faf87e8ff96e27c7e2b8175f9387)
* util_tdb: remove trivial and unused tdb_wipe().Michael Adam2008-03-271-17/+0
| | | | | | | It has been replaced by tdb_wipe_all(). Michael (cherry picked from commit cdde2e4eaca51d51f036ad99d55df7bfd6535b03)
* util_tdb: make the _byblob fetch/store functions public again.Michael Adam2008-03-271-4/+4
| | | | | | | Users of these are currently being written... Michael (cherry picked from commit 1c51bec5318bad085c09931aa7e8f72f41d103fe)
* util_tdb: add my (C) for the tdb validation codeMichael Adam2008-03-271-0/+1
| | | | | Michael (cherry picked from commit abf02a5a142c55d9e0053d319c867e4fcc3e6c30)
* util_tdb: add a wrapper tdb_wipe() for traverse with tdb_traverse_delete_fn().Michael Adam2008-03-271-2/+8
| | | | | | | | Replace all callers of traverse with this tdb_traverse_delete_fn() and don't export tdb_traverse_delete_fn() anymore. Michael (cherry picked from commit d4be4e30cd8c3bdc303da30e42280f892a45a8c9)
* util_tdb: make the _byblob functions static - not currently used elsewhere.Michael Adam2008-03-271-5/+5
| | | | | Michael (cherry picked from commit b42cf3fc69414270be9d0f430f2e95a72894f00e)
* Fix some warningsVolker Lendecke2008-02-251-7/+9
| | | | warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result
* Adding missing calls to va_end().Tim Potter2008-01-271-0/+1
| | | | | | | | Just a small commit to get a handle on this git thingy. This patch fixes some missing calls to va_end() to match various calls to va_start() and VA_COPY(). Tim.
* Change tdb_unpack "P" to return a malloc'ed string ratherJeremy Allison2007-12-031-10/+9
| | | | | | than expect a pstring space to put data into. Fix the (few) callers. Jeremy.
* Fix bug where tdb lock call interrupted withJeremy Allison2007-11-061-0/+2
| | | | | | | | an alarm sig would not terminate and could lead to runaway smbd processes. Thanks to Dave Daugherty @ Centrify for pointing this out to us. Jeremy.
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-11/+11
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* r24877: Don't panic in tdb validation code when the fork or waitpid fails.Michael Adam2007-10-101-5/+7
| | | | | | Return error instead. Michael
* r24848: Make tdb_validate() take an open tdb handle instead of a file name.Michael Adam2007-10-101-16/+41
| | | | | | | | | | | A new wrapper tdb_validate_open() takes a filename an opens and closes the tdb before and after calling tdb_validate() respectively. winbindd_validata_cache_nobackup() now dynamically calls one of the above functions depending on whether the cache tdb has already been opened or not. Michael
* r24847: Change standard failure return code of tdb_validate from "-1" to "1".Michael Adam2007-10-101-2/+2
| | | | | | (This is more safely used with casts from int to uint8, e.g.) Michael
* r24267: Fix the build farmVolker Lendecke2007-10-101-2/+2
| | | | | I had only tested with "net getlocalsid". posix_locking_init() calls this with a NULL name...
* r24265: Add the tdb_hashsize:<tdbname> parameterVolker Lendecke2007-10-101-0/+22
| | | | | | | | | | This makes it possible to set the default hashsize for any tdb. I would like to remove the "open files database hash size" in favor of this one. I'll check that removal in with the next commit, please complain/revert if it's not ok. Volker
* r23981: Make tdb_validate_and_backup try harder to end up with a valid tdb:Michael Adam2007-10-101-23/+60
| | | | | | | | | If restoring a backup fails due to lack of space, remove the corrupt tdb previously moved away to "name.corrupt", and retry. If restoring still fails, move the backup in place instead of copying it. Michael
* r23975: Enhance some debug output.Michael Adam2007-10-101-2/+4
|
* r23957: Use tdb_open_log instead of tdb_open.Michael Adam2007-10-101-6/+6
| | | | Michael
* r23952: Streamline and improve the logic of tdb_validate_and backup:Michael Adam2007-10-101-29/+63
| | | | | | | | | | | | | | | | | | | | | | - call tdb_validate on the given tdb. - if validation is successful, create a backup return 0 (success) even if the backup fails. - if validation fails: - move tdb to name.corrupt (don't exit if this fails) - look for a valid backup - if a valid backup is found, restore it, else return -1 (failure) if restoring succeeds, return 0 (success), else -1 (failure) Summing up: If 0 is returned, there is a valid tdb at the given location: either the original one ore one restrored from a backup. If -1 is returned, there is no valid tdb at the given location: Either there is no file at all, or the original file is still in place (if moving it away failed). Michael
* r23938: Add a debug message.Michael Adam2007-10-101-0/+2
|
* r23932: Fill extended status with information in case the validation traverseMichael Adam2007-10-101-1/+5
| | | | | | | | functions did not do so but returned an error. (This is the case when error occurred deeper than at the level of the content checking done by the per entry validate_fn.) Michael
* r23930: Introduce tdb_validate_and_backup:Michael Adam2007-10-101-1/+239
| | | | | | | | | | | | | | | | | | This is a wrapper around tdb_validate, that does backup handling: * if the given tdb is valid, a backup is created (name.bak) * if the tdb is invalid, if a valid bakup is found (validated with the same validation function) under the name "name.bak" the orignal tdb is moved to name.corrupt and the backup is restored. For the backup handling, a variant of the backup_tdb function from lib/tdb/tools/tdbbackup.c is included in lib/util_tdb.c. The copy function for the traverse action eliminates the need to maintain a global success state by using a struct wrapping the target tdb and a success flag as the private data. Michael
* r23828: Add entry and exit debug statments to tdb_validateMichael Adam2007-10-101-0/+5
| | | | | | at a lower debug level. Michael
* r23822: Clean some debugging output (as well in content andMichael Adam2007-10-101-34/+19
| | | | | | amount as in source code formatting...) Michael
* r23819: It is currently unnecessary to pass the extended validation statusMichael Adam2007-10-101-42/+10
| | | | | | | | from the validating child process down to the parent though the pipe. All the parent evaluates is the overall success, so the exit status should do. Michael
* r23814: Fix a couple of comments and debug messages.Michael Adam2007-10-101-7/+7
|
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23769: Move removal of the tdb from the generic tdb_validate functionMichael Adam2007-10-101-6/+0
| | | | | | | to the caller (winbindd_validate_cache in this case). Next, there will be a backup handling for the tdb files. Michael
* r23751: Call tdb_close even when validation was not successful.Michael Adam2007-10-101-9/+1
| | | | Michael
* r23639: Eliminate trailing whitespaces in the new tdb_validate functions...Michael Adam2007-10-101-8/+7
| | | | Michael
* r23610: Move some winbindd_cache specific flags and actionsMichael Adam2007-10-101-7/+1
| | | | | | | | back to winbindd_cache.c. The generic mechanism should open the cache tdb readonly and with default flags. Michael
* r23600: First step in abstracting the winbindd cache validationMichael Adam2007-10-101-0/+203
| | | | | | | code into a generic tdb validation code. In lib/util_tdb.c for a start. Michael
* r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach2007-10-101-2/+2
| | | | failed expression in SMB_ASSERT.
* r23362: Respect "use mmap" in tdb_wrap_open(). Tridge, you might want to mergeVolker Lendecke2007-10-101-0/+3
| | | | this in your tree.
* r23170: Add map_nt_error_from_tdb()Volker Lendecke2007-10-101-0/+37
|
* r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher2007-10-101-15/+15
| | | | | | and fix all compiler warnings in the users metze
* r22007: make string_tdb_data(NULL) possible...Stefan Metzmacher2007-10-101-2/+2
| | | | metze
* r21972: - add string_term_tdb_data() it creates a null-terminates tdb key ↵Stefan Metzmacher2007-10-101-23/+32
| | | | | | | | | from a string (the current string_tdb_data() creates a non-terminates tdb key from a string!) - pass TDB_DATA instead of const char *, size_t len to some functions metze
* r21960: Fix bugs 4463,4464,4465,4466. Thanks Jason :-)Volker Lendecke2007-10-101-13/+0
|
* r21076: Two pieces of infrastructure from Samba4: An API-compatible ↵Volker Lendecke2007-10-101-0/+98
| | | | | | | | messaging wrapper and tdb_wrap_open. Volker
* r19841: Wrap regdb_store_keys and regdb_store_values in tdb transactionsVolker Lendecke2007-10-101-0/+8
|
* r19448: Convert delete_share_security to struct share_params plus some cleanupsVolker Lendecke2007-10-101-0/+29
|
* r19429: moved tdb/common/tdbutil.c into lib/util_tdb.cAndrew Tridgell2007-10-101-0/+811
see discussion on samba-technical