summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-19 11:45:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:04 -0500
commit4218d574d718255f5f180d8d13bde450ffa5b548 (patch)
treeba66ab0d405f586f43d14977950cd8b42aa6a22b /source3/tdb
parent39c1ebff22aaacbe2745e7b6ad832e9ed302fe81 (diff)
downloadsamba-4218d574d718255f5f180d8d13bde450ffa5b548.tar.gz
samba-4218d574d718255f5f180d8d13bde450ffa5b548.tar.bz2
samba-4218d574d718255f5f180d8d13bde450ffa5b548.zip
r21445: Apply tdb_parse_record Tridges error return, merge to 3_0_25 and 4_0
(This used to be commit c852d9b56971673fc62eec3460720478d81c279d)
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/common/tdb.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/source3/tdb/common/tdb.c b/source3/tdb/common/tdb.c
index 008b168734..bf4c01d1b3 100644
--- a/source3/tdb/common/tdb.c
+++ b/source3/tdb/common/tdb.c
@@ -183,19 +183,14 @@ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
{
tdb_off_t rec_ptr;
struct list_struct rec;
- TDB_DATA data;
int ret;
u32 hash;
/* find which hash bucket it is in */
hash = tdb->hash_fn(&key);
- rec_ptr = tdb_find_lock_hash(tdb,key,hash,F_RDLCK,&rec);
-
- if (rec_ptr == 0) {
- data.dptr = NULL;
- data.dsize = 0;
- return parser(key, data, private_data);
+ if (!(rec_ptr = tdb_find_lock_hash(tdb,key,hash,F_RDLCK,&rec))) {
+ return TDB_ERRCODE(TDB_ERR_NOEXIST, 0);
}
ret = tdb_parse_data(tdb, key, rec_ptr + sizeof(rec) + rec.key_len,
@@ -204,9 +199,7 @@ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);
return ret;
-
}
-
/* check if an entry in the database exists