diff options
author | Gregor Beck <gbeck@sernet.de> | 2011-03-18 14:39:15 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-04-04 15:57:35 +0200 |
commit | 340f20ddb01da08b6a6ad11143768ffd69b7944e (patch) | |
tree | e1030662748066f1bd92518a445dd4135b4c3116 | |
parent | 84019ea5288ec3ec83739aa8142ec50cef0f1b82 (diff) | |
download | samba-340f20ddb01da08b6a6ad11143768ffd69b7944e.tar.gz samba-340f20ddb01da08b6a6ad11143768ffd69b7944e.tar.bz2 samba-340f20ddb01da08b6a6ad11143768ffd69b7944e.zip |
s3: add function dbwrap_traverse
-rw-r--r-- | source3/include/dbwrap.h | 4 | ||||
-rw-r--r-- | source3/lib/dbwrap_util.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h index 3d4de27922..ef35b0071d 100644 --- a/source3/include/dbwrap.h +++ b/source3/include/dbwrap.h @@ -130,6 +130,10 @@ NTSTATUS dbwrap_trans_do(struct db_context *db, NTSTATUS dbwrap_trans_traverse(struct db_context *db, int (*f)(struct db_record*, void*), void *private_data); +NTSTATUS dbwrap_traverse(struct db_context *db, + int (*f)(struct db_record*, void*), + void *private_data); + NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key); NTSTATUS dbwrap_store_bystring_upper(struct db_context *db, const char *key, TDB_DATA data, int flags); diff --git a/source3/lib/dbwrap_util.c b/source3/lib/dbwrap_util.c index 6e5f14af33..35f8a14d0d 100644 --- a/source3/lib/dbwrap_util.c +++ b/source3/lib/dbwrap_util.c @@ -443,6 +443,14 @@ NTSTATUS dbwrap_trans_traverse(struct db_context *db, return dbwrap_trans_do(db, dbwrap_trans_traverse_action, &ctx); } +NTSTATUS dbwrap_traverse(struct db_context *db, + int (*f)(struct db_record*, void*), + void *private_data) +{ + int ret = db->traverse(db, f, private_data); + return (ret == -1) ? NT_STATUS_INTERNAL_DB_CORRUPTION : NT_STATUS_OK; +} + |