From b64494535dc62f4073fc6302847593ed6e6ec38b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 19 Dec 2011 15:47:50 +1030 Subject: tdb: be more careful on 4G files. I came across a tdb which had wrapped to 4G + 4K, and the contents had been destroyed by processes which thought it only 4k long. Fix this by checking on open, and making tdb_oob() check for wrap itself. Signed-off-by: Rusty Russell Autobuild-User: Rusty Russell Autobuild-Date: Mon Dec 19 07:52:01 CET 2011 on sn-devel-104 --- lib/tdb/common/tdb_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tdb/common/tdb_private.h') diff --git a/lib/tdb/common/tdb_private.h b/lib/tdb/common/tdb_private.h index 140d4ecec5..3c6aabffc7 100644 --- a/lib/tdb/common/tdb_private.h +++ b/lib/tdb/common/tdb_private.h @@ -180,7 +180,7 @@ struct tdb_methods { int (*tdb_read)(struct tdb_context *, tdb_off_t , void *, tdb_len_t , int ); int (*tdb_write)(struct tdb_context *, tdb_off_t, const void *, tdb_len_t); void (*next_hash_chain)(struct tdb_context *, uint32_t *); - int (*tdb_oob)(struct tdb_context *, tdb_off_t , int ); + int (*tdb_oob)(struct tdb_context *, tdb_off_t , tdb_len_t, int ); int (*tdb_expand_file)(struct tdb_context *, tdb_off_t , tdb_off_t ); }; -- cgit