mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-26 14:04:12 +03:00
Merge pull request #2865 from barthalion/increase-metadata-size
Increase the metadata size limit to 128MB
This commit is contained in:
commit
9244518896
@ -35,7 +35,7 @@ G_BEGIN_DECLS
|
||||
* objects). This is an arbitrary number intended to mitigate disk space
|
||||
* exhaustion attacks.
|
||||
*/
|
||||
#define OSTREE_MAX_METADATA_SIZE (10 * 1024 * 1024)
|
||||
#define OSTREE_MAX_METADATA_SIZE (128 * 1024 * 1024)
|
||||
|
||||
/**
|
||||
* OSTREE_MAX_METADATA_WARN_SIZE:
|
||||
|
@ -417,7 +417,7 @@ test_big_metadata (void)
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret);
|
||||
|
||||
const size_t len = 20 * 1024 * 1024;
|
||||
const size_t len = OSTREE_MAX_METADATA_SIZE + 1;
|
||||
g_assert_cmpint (len, >, OSTREE_MAX_METADATA_SIZE);
|
||||
g_autofree char *large_buf = g_malloc (len);
|
||||
memset (large_buf, 0x42, len);
|
||||
|
@ -25,10 +25,11 @@ setup_fake_remote_repo1 "archive"
|
||||
|
||||
echo '1..1'
|
||||
|
||||
# Overwrite the commit object with 20 M of
|
||||
# Overwrite the commit object with 121 M of zeroes. This is based on the
|
||||
# OSTREE_MAX_METADATA_SIZE constant in src/libostree/ostree-core.h
|
||||
cd ${test_tmpdir}
|
||||
rev=$(cd ostree-srv && ${CMD_PREFIX} ostree --repo=gnomerepo rev-parse main)
|
||||
dd if=/dev/zero bs=1M count=20 of=ostree-srv/gnomerepo/objects/$(echo $rev | cut -b 1-2)/$(echo $rev | cut -b 3-).commit
|
||||
dd if=/dev/zero bs=1M count=130 of=ostree-srv/gnomerepo/objects/$(echo $rev | cut -b 1-2)/$(echo $rev | cut -b 3-).commit
|
||||
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo
|
||||
|
Loading…
x
Reference in New Issue
Block a user