]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix for rare tdb pattern store failure. Found & fixed by Rusty.
authorJeremy Allison <jra@samba.org>
Tue, 31 Jul 2001 00:03:24 +0000 (00:03 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 31 Jul 2001 00:03:24 +0000 (00:03 +0000)
Jeremy.

source/tdb/tdb.c

index 940825e41d85372d1e40e93c0549d92dca6f4080..c84af49b31cb739efd04b2273f622a90da33e807 100644 (file)
@@ -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)