From: Jeremy Allison Date: Tue, 31 Jul 2001 00:03:24 +0000 (+0000) Subject: Fix for rare tdb pattern store failure. Found & fixed by Rusty. X-Git-Tag: samba-2.2.5pre1~1737^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aaa56bb3a3c5f0e4191c9b3efe9b8d92c22cf6c7;p=thirdparty%2Fsamba.git Fix for rare tdb pattern store failure. Found & fixed by Rusty. Jeremy. --- diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c index 940825e41d8..c84af49b31c 100644 --- a/source/tdb/tdb.c +++ b/source/tdb/tdb.c @@ -875,7 +875,10 @@ static int tdb_update(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf) if (!(rec_ptr = tdb_find_lock(tdb, key, F_WRLCK, &rec))) return -1; /* must be long enough key, data and tailer */ - if (rec.rec_len < key.dsize + dbuf.dsize + sizeof(tdb_off)) goto out; + if (rec.rec_len < key.dsize + dbuf.dsize + sizeof(tdb_off)) { + tdb->ecode = TDB_SUCCESS; /* Not really an error */ + goto out; + } if (tdb_write(tdb, rec_ptr + sizeof(rec) + rec.key_len, dbuf.dptr, dbuf.dsize) == -1)