diff options
author | Gregor Beck <gbeck@sernet.de> | 2011-07-05 13:43:59 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 14:17:55 +0200 |
commit | c5d03cbff806c564d4903277bd2b866ba8bf9c7e (patch) | |
tree | 4ba2eb275b752f171c35cb049dbcde565f47247d /source3 | |
parent | 99fa6fa4a3845cdb6cbc6be0cdcdf1d8a4b49a3c (diff) | |
download | samba-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')
-rw-r--r-- | source3/lib/dbwrap/dbwrap.c | 12 |
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; } /* |