git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85c1f5f
)
when creating the database zero the reserved space
author
Andrew Tridgell
<tridge@samba.org>
Wed, 10 May 2000 12:58:20 +0000
(12:58 +0000)
committer
Andrew Tridgell
<tridge@samba.org>
Wed, 10 May 2000 12:58:20 +0000
(12:58 +0000)
(This used to be commit
a5ca60f62bea988e74e2827fbb848770ac5ae444
)
source3/tdb/tdb.c
patch
|
blob
|
history
diff --git
a/source3/tdb/tdb.c
b/source3/tdb/tdb.c
index 35951a0d174a36c4ff7cb923ebea854d6a44971d..bc7c90613c1b417e90e38a8578e1b30ad65be5da 100644
(file)
--- 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;