diff options
author | Michael Adam <obnox@samba.org> | 2011-08-17 09:59:25 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 14:17:55 +0200 |
commit | 87f51bfa99889c4700697556466cc694e2e6644d (patch) | |
tree | bef66cc7bf950b60a43693f11c914cdcc2dab4fc /source3/lib/dbwrap | |
parent | 8f098a635f713652c4846d71e24c0a199c25b8b7 (diff) | |
download | samba-87f51bfa99889c4700697556466cc694e2e6644d.tar.gz samba-87f51bfa99889c4700697556466cc694e2e6644d.tar.bz2 samba-87f51bfa99889c4700697556466cc694e2e6644d.zip |
s3:dbwrap: add a wrapper dbwrap_traverse_read()
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r-- | source3/lib/dbwrap/dbwrap.c | 18 | ||||
-rw-r--r-- | source3/lib/dbwrap/dbwrap.h | 4 |
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 */ |