summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-12-08 14:01:27 +0100
committerVolker Lendecke <vl@samba.org>2011-12-08 15:03:43 +0100
commit4856033410db98b44d76e82f649634e13eba221f (patch)
treef00ab1fe01d3f5b6a23c6d12c846ddd6dee2a5f6 /source3/lib/dbwrap
parentd9e5368fcccf02164c2bdc0fc679b71e7cfa510f (diff)
downloadsamba-4856033410db98b44d76e82f649634e13eba221f.tar.gz
samba-4856033410db98b44d76e82f649634e13eba221f.tar.bz2
samba-4856033410db98b44d76e82f649634e13eba221f.zip
s3-dbwrap: Make dbwrap_fallback_wipe private
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__ */