git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 3/3] receive-pack: allow a maximum input size to be specified

From
Jeff King <peff@peff.net>
Date
Aug 24, 2016, 18:54 UTC
Message-ID
<20160824185428.6k6tatv4cc5pre5c@sigill.intra.peff.net>
In-Reply-To
<20160824184157.19264-4-chriscool@tuxfamily.org>
On Wed, Aug 24, 2016 at 08:41:57PM +0200, Christian Couder wrote:
Show 5 quoted lines
> +test_pack_input_limit () {
> +	case "$1" in
> +	index) unpack_limit=1 ;;
> +	unpack) unpack_limit=10000 ;;
> +	esac
Nice, this is pretty self-explanatory.
Show 18 quoted lines
> +	test_expect_success 'prepare destination repository' '
> +		rm -fr dest &&
> +		git --bare init dest
> +	'
> +
> +	test_expect_success "set unpacklimit to $unpack_limit" '
> +		git --git-dir=dest config receive.unpacklimit "$unpack_limit"
> +	'
> +
> +	test_expect_success 'setting receive.maxInputSize to 512 rejects push' '
> +		git --git-dir=dest config receive.maxInputSize 512 &&
> +		test_must_fail git push dest HEAD
> +	'
> +
> +	test_expect_success 'bumping limit to 4k allows push' '
> +		git --git-dir=dest config receive.maxInputSize 4k &&
> +		git push dest HEAD
> +	'
Makes sense. We couldn't push, and then we could.
Show 9 quoted lines
> +	test_expect_success 'prepare destination repository (again)' '
> +		rm -fr dest &&
> +		git --bare init dest
> +	'
> +
> +	test_expect_success 'lifting the limit allows push' '
> +		git --git-dir=dest config receive.maxInputSize 0 &&
> +		git push dest HEAD
> +	'

This is new in this iteration, I think. At first I thought "but every _other_ test script is implicitly testing that we work without the limit". But this is showing that setting the limit explicitly to 0 does work, which is good.

The whole series looks fine to me.
-Peff
Previous: Christian CouderNext: Junio C Hamano
Message 5 of 6 in “limit the size of the packs we receive”
  1. 0/3 limit the size of the packs we receiveChristian Couder, Aug 24, 2016
  2. 1/3 index-pack: add --max-input-size=<size> optionChristian Couder, Aug 24, 2016
  3. 2/3 unpack-objects: add --max-input-size=<size> optionChristian Couder, Aug 24, 2016
  4. 3/3 receive-pack: allow a maximum input size to be specifiedChristian Couder, Aug 24, 2016
  5. Jeff KingAug 24, 2016
  6. Junio C HamanoAug 24, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.