mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
s3:dbwrap: implement dbwrap_fallback_exists() with dbwrap_parse_record()
Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
99fa6fa4a3
commit
c5d03cbff8
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user