diff options
author | Michael Adam <obnox@samba.org> | 2007-07-18 11:43:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:28:49 -0500 |
commit | 21a847473da54b6e4b41a94f781a2935f482ebaa (patch) | |
tree | 136766f4fac58057bb718ca9122c43f0e1003bc8 /examples/printer-accounting/acct-all | |
parent | e6875b1b45577917ff9b465623502f49755aa612 (diff) | |
download | samba-21a847473da54b6e4b41a94f781a2935f482ebaa.tar.gz samba-21a847473da54b6e4b41a94f781a2935f482ebaa.tar.bz2 samba-21a847473da54b6e4b41a94f781a2935f482ebaa.zip |
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 1c36ccd86d85b02f27ec66d37bdf7f04ad760901)
Diffstat (limited to 'examples/printer-accounting/acct-all')
0 files changed, 0 insertions, 0 deletions