diff options
Diffstat (limited to 'lib/dbwrap/dbwrap.c')
-rw-r--r-- | lib/dbwrap/dbwrap.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c index a393960428..d46044f0c4 100644 --- a/lib/dbwrap/dbwrap.c +++ b/lib/dbwrap/dbwrap.c @@ -50,6 +50,19 @@ static int dbwrap_fallback_wipe(struct db_context *db) return NT_STATUS_IS_OK(status) ? 0 : -1; } +static int do_nothing(struct db_record *rec, void *unused) +{ + return 0; +} + +/* + * Fallback check operation: just traverse. + */ +static int dbwrap_fallback_check(struct db_context *db) +{ + NTSTATUS status = dbwrap_traverse_read(db, do_nothing, NULL, NULL); + return NT_STATUS_IS_OK(status) ? 0 : -1; +} /* * Wrapper functions for the backend methods @@ -367,6 +380,14 @@ int dbwrap_wipe(struct db_context *db) return db->wipe(db); } +int dbwrap_check(struct db_context *db) +{ + if (db->check == NULL) { + return dbwrap_fallback_check(db); + } + return db->check(db); +} + int dbwrap_get_seqnum(struct db_context *db) { return db->get_seqnum(db); |