diff options
author | Volker Lendecke <vl@samba.org> | 2008-01-24 19:06:25 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-02-02 11:03:21 +0100 |
commit | fa5391a919cf729134d9ec0368fced9cc028d02e (patch) | |
tree | 2f2fdd8ba88a0bb7928139e32f32f0cace5a8127 /source3 | |
parent | b5cd038000e6156f795095e5f845356baec6ca44 (diff) | |
download | samba-fa5391a919cf729134d9ec0368fced9cc028d02e.tar.gz samba-fa5391a919cf729134d9ec0368fced9cc028d02e.tar.bz2 samba-fa5391a919cf729134d9ec0368fced9cc028d02e.zip |
Return NOTFOUND from db_tdb_delete if the record does not exist
(This used to be commit 1ff924c4360952eb1d714a2f2ec3760b380c7a24)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/dbwrap_tdb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/lib/dbwrap_tdb.c b/source3/lib/dbwrap_tdb.c index 18f9495931..da55049e52 100644 --- a/source3/lib/dbwrap_tdb.c +++ b/source3/lib/dbwrap_tdb.c @@ -196,8 +196,15 @@ static NTSTATUS db_tdb_delete(struct db_record *rec) struct db_tdb_ctx *ctx = talloc_get_type_abort(rec->private_data, struct db_tdb_ctx); - return (tdb_delete(ctx->wtdb->tdb, rec->key) == 0) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; + if (tdb_delete(ctx->wtdb->tdb, rec->key) == 0) { + return NT_STATUS_OK; + } + + if (tdb_error(ctx->wtdb->tdb) == TDB_ERR_NOEXIST) { + return NT_STATUS_NOT_FOUND; + } + + return NT_STATUS_UNSUCCESSFUL; } struct db_tdb_traverse_ctx { |