summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-12-08 13:56:07 +0100
committerVolker Lendecke <vl@samba.org>2011-12-08 15:03:43 +0100
commit527dc2ed52c78b1ae114207736883759638db5d1 (patch)
tree8542277ef6bca3528833223eac4c4ef373ece5b5 /source3/lib/dbwrap
parentb6d5dfc16db83790e833397ee35ea28711b8cec8 (diff)
downloadsamba-527dc2ed52c78b1ae114207736883759638db5d1.tar.gz
samba-527dc2ed52c78b1ae114207736883759638db5d1.tar.bz2
samba-527dc2ed52c78b1ae114207736883759638db5d1.zip
s3-dbwrap: Make dbwrap_fallback_fetch private
Diffstat (limited to 'source3/lib/dbwrap')
-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,