From 4856033410db98b44d76e82f649634e13eba221f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 8 Dec 2011 14:01:27 +0100 Subject: [PATCH] s3-dbwrap: Make dbwrap_fallback_wipe private --- source3/lib/dbwrap/dbwrap.c | 5 ++++- source3/lib/dbwrap/dbwrap_open.c | 5 ----- source3/lib/dbwrap/dbwrap_private.h | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index 587fc8a4819..f6f96befedd 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 7865fe7c8c5..6b8be2de16c 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 3e8b1c189a7..1491a134e72 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__ */ -- 2.34.1