summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-07-05 13:43:59 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:55 +0200
commitc5d03cbff806c564d4903277bd2b866ba8bf9c7e (patch)
tree4ba2eb275b752f171c35cb049dbcde565f47247d /source3/lib/dbwrap
parent99fa6fa4a3845cdb6cbc6be0cdcdf1d8a4b49a3c (diff)
downloadsamba-c5d03cbff806c564d4903277bd2b866ba8bf9c7e.tar.gz
samba-c5d03cbff806c564d4903277bd2b866ba8bf9c7e.tar.bz2
samba-c5d03cbff806c564d4903277bd2b866ba8bf9c7e.zip
s3:dbwrap: implement dbwrap_fallback_exists() with dbwrap_parse_record()
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c
index 92f82e6779..af8e28cb7e 100644
--- a/source3/lib/dbwrap/dbwrap.c
+++ b/source3/lib/dbwrap/dbwrap.c
@@ -49,16 +49,8 @@ int dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
static int dbwrap_fallback_exists(struct db_context *db, TDB_DATA key)
{
- TDB_DATA val;
- if ( db->fetch(db, talloc_tos(), key, &val) != 0 ) {
- return 0;
- }
- if (val.dptr == NULL ) {
- return 0;
- } else {
- TALLOC_FREE(val.dptr);
- return 1;
- }
+ int res = dbwrap_parse_record(db, key, NULL, NULL);
+ return ( res == -1) ? 0 : 1;
}
/*