summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/dbwrap/dbwrap.c18
-rw-r--r--source3/lib/dbwrap/dbwrap.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c
index 614251c06f..c2d28b3a0e 100644
--- a/source3/lib/dbwrap/dbwrap.c
+++ b/source3/lib/dbwrap/dbwrap.c
@@ -126,3 +126,21 @@ NTSTATUS dbwrap_traverse(struct db_context *db,
return NT_STATUS_OK;
}
+
+NTSTATUS dbwrap_traverse_read(struct db_context *db,
+ int (*f)(struct db_record*, void*),
+ void *private_data,
+ int *count)
+{
+ int ret = db->traverse_read(db, f, private_data);
+
+ if (ret < 0) {
+ return NT_STATUS_INTERNAL_DB_CORRUPTION;
+ }
+
+ if (count != NULL) {
+ *count = ret;
+ }
+
+ return NT_STATUS_OK;
+}
diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h
index 7dda1bae52..2ba96b2482 100644
--- a/source3/lib/dbwrap/dbwrap.h
+++ b/source3/lib/dbwrap/dbwrap.h
@@ -67,6 +67,10 @@ NTSTATUS dbwrap_traverse(struct db_context *db,
int (*f)(struct db_record*, void*),
void *private_data,
int *count);
+NTSTATUS dbwrap_traverse_read(struct db_context *db,
+ int (*f)(struct db_record*, void*),
+ void *private_data,
+ int *count);
/* The following definitions come from lib/dbwrap_util.c */