git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v3 3/3] receive-pack: allow a maximum input size to be specified
Date: Wed, 24 Aug 2016 14:54:28 -0400	[thread overview]
Message-ID: <20160824185428.6k6tatv4cc5pre5c@sigill.intra.peff.net> (raw)
In-Reply-To: <20160824184157.19264-4-chriscool@tuxfamily.org>

On Wed, Aug 24, 2016 at 08:41:57PM +0200, Christian Couder wrote:

> +test_pack_input_limit () {
> +	case "$1" in
> +	index) unpack_limit=1 ;;
> +	unpack) unpack_limit=10000 ;;
> +	esac

Nice, this is pretty self-explanatory.

> +	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.

> +	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

  reply	other threads:[~2016-08-24 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 18:41 [PATCH v3 0/3] limit the size of the packs we receive Christian Couder
2016-08-24 18:41 ` [PATCH v3 1/3] index-pack: add --max-input-size=<size> option Christian Couder
2016-08-24 18:41 ` [PATCH v3 2/3] unpack-objects: " Christian Couder
2016-08-24 18:41 ` [PATCH v3 3/3] receive-pack: allow a maximum input size to be specified Christian Couder
2016-08-24 18:54   ` Jeff King [this message]
2016-08-24 19:30 ` [PATCH v3 0/3] limit the size of the packs we receive Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160824185428.6k6tatv4cc5pre5c@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).