aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/kdb/db2/libdb2/hash
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2009-01-23 18:04:08 +0000
committerKen Raeburn <raeburn@mit.edu>2009-01-23 18:04:08 +0000
commit5c2d383292d4080d31e834919a527427fe1ecbe8 (patch)
tree419f3b4b60588cd34ee0cbf3eb63764ae2a3fcaa /src/plugins/kdb/db2/libdb2/hash
parent69350842f4846ed7b383ef6734d134fd32de8925 (diff)
downloadkrb5-5c2d383292d4080d31e834919a527427fe1ecbe8.zip
krb5-5c2d383292d4080d31e834919a527427fe1ecbe8.tar.gz
krb5-5c2d383292d4080d31e834919a527427fe1ecbe8.tar.bz2
hash db2 code breaks if st_blksize > 64k
The hash db code assumes in places that the block size is no larger than 64K. There's a range check in the case where you don't have a file but provide initialization info. The btree code will cap the block size used at 64K. Apparently Sun's ZFS can report back a block size of 128K, causing the db2 tests to fail. Add such a cap to the hash db creation code. Note that our default configuration is to use the btree code when creating a new database, so it's unlikely that this will cause real-world problems unless someone went out of their way to specify use of the hash format. ticket: 6342 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21786 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins/kdb/db2/libdb2/hash')
-rw-r--r--src/plugins/kdb/db2/libdb2/hash/hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.c b/src/plugins/kdb/db2/libdb2/hash/hash.c
index b68b1dc..c1a6608 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash.c
@@ -328,6 +328,8 @@ init_hash(hashp, file, info)
if (stat(file, &statbuf))
return (NULL);
hashp->hdr.bsize = statbuf.st_blksize;
+ if (hashp->hdr.bsize > MAX_BSIZE)
+ hashp->hdr.bsize = MAX_BSIZE;
hashp->hdr.bshift = __log2(hashp->hdr.bsize);
}
if (info) {