From b3d4c0c9f56bd654ba92f3967eb4330354b84c63 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 May 2000 12:58:20 +0000 Subject: when creating the database zero the reserved space (This used to be commit a5ca60f62bea988e74e2827fbb848770ac5ae444) --- source3/tdb/tdb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index 35951a0d17..bc7c90613c 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -498,6 +498,7 @@ static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size) tdb_off offset; int i, size = 0; tdb_off buf[16]; + char buf2[TDB_RESERVED]; /* create the header */ memset(&header, 0, sizeof(header)); @@ -514,6 +515,13 @@ static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size) tdb->ecode = TDB_ERR_IO; return -1; } else size += sizeof(header); + + memset(buf2, 0, sizeof(buf2)); + if (tdb->fd != -1 && write(tdb->fd, buf2, TDB_RESERVED) != + TDB_RESERVED) { + tdb->ecode = TDB_ERR_IO; + return -1; + } else size += TDB_RESERVED; /* the freelist and hash pointers */ offset = 0; -- cgit