1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

31 Commits

Author SHA1 Message Date
Volker Lendecke
42c1eca265 r24267: Fix the build farm
I had only tested with "net getlocalsid". posix_locking_init() calls this
with a NULL name...
(This used to be commit 3eee1fe280)
2007-10-10 12:29:22 -05:00
Volker Lendecke
8c154674c6 r24265: Add the tdb_hashsize:<tdbname> parameter
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
(This used to be commit e9bd7a63a8)
2007-10-10 12:29:21 -05:00
Michael Adam
7712e7eeb6 r23981: Make tdb_validate_and_backup try harder to end up with a valid tdb:
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
(This used to be commit f81f2bf480)
2007-10-10 12:28:52 -05:00
Michael Adam
6a16ad09cb r23975: Enhance some debug output.
(This used to be commit 909172839a)
2007-10-10 12:28:51 -05:00
Michael Adam
b8a4863ca4 r23957: Use tdb_open_log instead of tdb_open.
Michael
(This used to be commit efabd7fe03)
2007-10-10 12:28:49 -05:00
Michael Adam
21a847473d r23952: Streamline and improve the logic of tdb_validate_and backup:
- 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
(This used to be commit 1c36ccd86d)
2007-10-10 12:28:49 -05:00
Michael Adam
f932dccd5d r23938: Add a debug message.
(This used to be commit 6bd2c48921)
2007-10-10 12:28:47 -05:00
Michael Adam
dc278f2d8f r23932: Fill extended status with information in case the validation traverse
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
(This used to be commit e56be59947)
2007-10-10 12:28:46 -05:00
Michael Adam
7291251efb r23930: Introduce tdb_validate_and_backup:
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
(This used to be commit ca63a99b61)
2007-10-10 12:28:46 -05:00
Michael Adam
f0072e5476 r23828: Add entry and exit debug statments to tdb_validate
at a lower debug level.

Michael
(This used to be commit b636f8cdad)
2007-10-10 12:28:31 -05:00
Michael Adam
d775ad4aba r23822: Clean some debugging output (as well in content and
amount as in source code formatting...)

Michael
(This used to be commit 9794b94ebf)
2007-10-10 12:28:30 -05:00
Michael Adam
0543963797 r23819: It is currently unnecessary to pass the extended validation status
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
(This used to be commit 9415ea0fde)
2007-10-10 12:28:30 -05:00
Michael Adam
344f7aa381 r23814: Fix a couple of comments and debug messages.
(This used to be commit ef40ef6764)
2007-10-10 12:28:29 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Michael Adam
5e4962d9e7 r23769: Move removal of the tdb from the generic tdb_validate function
to the caller (winbindd_validate_cache in this case).
Next, there will be a backup handling for the tdb files.

Michael
(This used to be commit 821bc84109)
2007-10-10 12:23:55 -05:00
Michael Adam
052ddc9cd0 r23751: Call tdb_close even when validation was not successful.
Michael
(This used to be commit b68856d990)
2007-10-10 12:23:52 -05:00
Michael Adam
839d4647a9 r23639: Eliminate trailing whitespaces in the new tdb_validate functions...
Michael
(This used to be commit d4accdbb52)
2007-10-10 12:23:39 -05:00
Michael Adam
7c48598e86 r23610: Move some winbindd_cache specific flags and actions
back to winbindd_cache.c. The generic mechanism
should open the cache tdb readonly and with default
flags.

Michael
(This used to be commit 062d8c6129)
2007-10-10 12:23:36 -05:00
Michael Adam
133472ac66 r23600: First step in abstracting the winbindd cache validation
code into a generic tdb validation code.
In lib/util_tdb.c for a start.

Michael
(This used to be commit 527edfa0cb)
2007-10-10 12:23:35 -05:00
James Peach
b1ce226af8 r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
(This used to be commit 171dc060e2)
2007-10-10 12:23:23 -05:00
Volker Lendecke
cc2b76b644 r23362: Respect "use mmap" in tdb_wrap_open(). Tridge, you might want to merge
this in your tree.
(This used to be commit c0f40eb584)
2007-10-10 12:23:10 -05:00
Volker Lendecke
7e27c984c4 r23170: Add map_nt_error_from_tdb()
(This used to be commit 02beae81c8)
2007-10-10 12:22:51 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
7bdd7ecafa r22007: make string_tdb_data(NULL) possible...
metze
(This used to be commit d030947083)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
2aee3c2689 r21972: - add string_term_tdb_data() it creates a null-terminates tdb key 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
(This used to be commit 815ef8acdc)
2007-10-10 12:18:54 -05:00
Volker Lendecke
eca13022ef r21960: Fix bugs 4463,4464,4465,4466. Thanks Jason :-)
(This used to be commit a2e27c4431)
2007-10-10 12:18:52 -05:00
Volker Lendecke
032bd8eea8 r21076: Two pieces of infrastructure from Samba4: An API-compatible messaging wrapper
and tdb_wrap_open.

Volker
(This used to be commit c01f164dca)
2007-10-10 12:17:33 -05:00
Volker Lendecke
7a19259051 r19841: Wrap regdb_store_keys and regdb_store_values in tdb transactions
(This used to be commit 5ec7379220)
2007-10-10 12:16:01 -05:00
Volker Lendecke
2a10d76865 r19448: Convert delete_share_security to struct share_params plus some cleanups
(This used to be commit c73d0815a3)
2007-10-10 12:15:36 -05:00
Andrew Tridgell
aa3ca346d8 r19429: moved tdb/common/tdbutil.c into lib/util_tdb.c
see discussion on samba-technical
(This used to be commit 1ad563286f)
2007-10-10 12:15:35 -05:00