summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap.c5
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c5
-rw-r--r--source3/lib/dbwrap/dbwrap_private.h2
3 files changed, 4 insertions, 8 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c
index 587fc8a481..f6f96befed 100644
--- a/source3/lib/dbwrap/dbwrap.c
+++ b/source3/lib/dbwrap/dbwrap.c
@@ -90,7 +90,7 @@ static int delete_record(struct db_record *rec, void *data)
* Fallback wipe ipmlementation using traverse and delete if no genuine
* wipe operation is provided
*/
-int dbwrap_fallback_wipe(struct db_context *db)
+static int dbwrap_fallback_wipe(struct db_context *db)
{
NTSTATUS status = dbwrap_trans_traverse(db, &delete_record, NULL);
return NT_STATUS_IS_OK(status) ? 0 : -1;
@@ -240,6 +240,9 @@ int dbwrap_parse_record(struct db_context *db, TDB_DATA key,
int dbwrap_wipe(struct db_context *db)
{
+ if (db->wipe == NULL) {
+ return dbwrap_fallback_wipe(db);
+ }
return db->wipe(db);
}
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 7865fe7c8c..6b8be2de16 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -109,10 +109,5 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
result = db_open_tdb(mem_ctx, name, hash_size,
tdb_flags, open_flags, mode);
}
-
- if ((result != NULL) && (result->wipe == NULL)) {
- result->wipe = dbwrap_fallback_wipe;
- }
-
return result;
}
diff --git a/source3/lib/dbwrap/dbwrap_private.h b/source3/lib/dbwrap/dbwrap_private.h
index 3e8b1c189a..1491a134e7 100644
--- a/source3/lib/dbwrap/dbwrap_private.h
+++ b/source3/lib/dbwrap/dbwrap_private.h
@@ -59,7 +59,5 @@ struct db_context {
bool persistent;
};
-int dbwrap_fallback_wipe(struct db_context *db);
-
#endif /* __DBWRAP_PRIVATE_H__ */