]> git.ipfire.org Git - thirdparty/samba.git/commit
r23930: Introduce tdb_validate_and_backup:
authorMichael Adam <obnox@samba.org>
Tue, 17 Jul 2007 12:49:22 +0000 (12:49 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:28:46 +0000 (12:28 -0500)
commit7291251efb6669c8895440e05edbb4967f0a4632
treeda9e72428541274331bd13142f3a1ddcfbae14b9
parentd9c902cb5959ab40be0a7f5a4d10f7fe84e927a4
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 ca63a99b6188c0976603dc2852e478cc7a6b2f8b)
source3/lib/util_tdb.c