summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/dbwrap/dbwrap.c9
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c3
-rw-r--r--source3/lib/dbwrap/dbwrap_private.h4
3 files changed, 6 insertions, 10 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c
index adda8e6060..1232b7991f 100644
--- a/source3/lib/dbwrap/dbwrap.c
+++ b/source3/lib/dbwrap/dbwrap.c
@@ -28,8 +28,9 @@
* Fall back using fetch_locked if no genuine fetch operation is provided
*/
-NTSTATUS dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
- TDB_DATA key, TDB_DATA *data)
+static NTSTATUS dbwrap_fallback_fetch(struct db_context *db,
+ TALLOC_CTX *mem_ctx,
+ TDB_DATA key, TDB_DATA *data)
{
struct db_record *rec;
@@ -133,7 +134,9 @@ NTSTATUS dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
if (value == NULL) {
return NT_STATUS_INVALID_PARAMETER;
}
-
+ if (db->fetch == NULL) {
+ return dbwrap_fallback_fetch(db, mem_ctx, key, value);
+ }
return db->fetch(db, mem_ctx, key, value);
}
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 47cc5a769e..bc2dbab449 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -110,9 +110,6 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
tdb_flags, open_flags, mode);
}
- if ((result != NULL) && (result->fetch == NULL)) {
- result->fetch = dbwrap_fallback_fetch;
- }
if ((result != NULL) && (result->parse_record == NULL)) {
result->parse_record = dbwrap_fallback_parse_record;
}
diff --git a/source3/lib/dbwrap/dbwrap_private.h b/source3/lib/dbwrap/dbwrap_private.h
index e7bd480cbb..5a7ca33513 100644
--- a/source3/lib/dbwrap/dbwrap_private.h
+++ b/source3/lib/dbwrap/dbwrap_private.h
@@ -59,10 +59,6 @@ struct db_context {
bool persistent;
};
-NTSTATUS dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
- TDB_DATA key, TDB_DATA *data);
-
-
int dbwrap_fallback_parse_record(struct db_context *db, TDB_DATA key,
int (*parser)(TDB_DATA key,
TDB_DATA data,