diff options
author | Jeremy Allison <jra@samba.org> | 2001-07-31 00:03:24 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-07-31 00:03:24 +0000 |
commit | 953973c888a7a29efd0eabd5ac21d10dfd91c685 (patch) | |
tree | d4b759e0b84fe8328d597dd697e898df37e0c1d9 /source3 | |
parent | a62c6e81fcf952d8937918a6d672b4b7ade07c76 (diff) | |
download | samba-953973c888a7a29efd0eabd5ac21d10dfd91c685.tar.gz samba-953973c888a7a29efd0eabd5ac21d10dfd91c685.tar.bz2 samba-953973c888a7a29efd0eabd5ac21d10dfd91c685.zip |
Fix for rare tdb pattern store failure. Found & fixed by Rusty.
Jeremy.
(This used to be commit aaa56bb3a3c5f0e4191c9b3efe9b8d92c22cf6c7)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/tdb/tdb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index 940825e41d..c84af49b31 100644 --- a/source3/tdb/tdb.c +++ b/source3/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) |