summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-07-05 13:42:39 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:55 +0200
commit99fa6fa4a3845cdb6cbc6be0cdcdf1d8a4b49a3c (patch)
tree91d5c8f00bd6cb1d91db2eefb64a0eeab83f8795 /source3/lib
parentf5b7d87c2563d0753445da8c1b75e67bd7668967 (diff)
downloadsamba-99fa6fa4a3845cdb6cbc6be0cdcdf1d8a4b49a3c.tar.gz
samba-99fa6fa4a3845cdb6cbc6be0cdcdf1d8a4b49a3c.tar.bz2
samba-99fa6fa4a3845cdb6cbc6be0cdcdf1d8a4b49a3c.zip
s3:dbwrap: allow NULL parser for dbwrap_parse_record()
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap/dbwrap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c
index 8cbf12e2b8..92f82e6779 100644
--- a/source3/lib/dbwrap/dbwrap.c
+++ b/source3/lib/dbwrap/dbwrap.c
@@ -174,11 +174,20 @@ NTSTATUS dbwrap_traverse_read(struct db_context *db,
return NT_STATUS_OK;
}
+static int dbwrap_null_parser(TDB_DATA key, TDB_DATA val, void* data)
+{
+ return 0;
+}
+
int dbwrap_parse_record(struct db_context *db, TDB_DATA key,
int (*parser)(TDB_DATA key, TDB_DATA data,
void *private_data),
void *private_data)
{
+ if (parser == NULL) {
+ parser = dbwrap_null_parser;
+ }
+
if (db->parse_record) {
return db->parse_record(db, key, parser, private_data);
} else {