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

2016-08-16 Thread Jeff King
On Tue, Aug 16, 2016 at 10:25:44AM +0200, Christian Couder wrote: > >> > Those are patches I plan to share upstream but just haven't gotten > >> > around to yet. > > I would be happy to help if I can on these patches too! Thanks. I'll try to extract the quarantine patches, though I have a few ot

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

2016-08-16 Thread Christian Couder
On Tue, Aug 16, 2016 at 3:03 AM, Jeff King wrote: > On Mon, Aug 15, 2016 at 03:48:55PM -0700, Junio C Hamano wrote: > >> Jeff King writes: >> >> > The simple fix is to call register_tempfile() in open_pack_file(), and >> > just have index-pack clean up the file on its way out. >> > >> > But there

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

2016-08-15 Thread Jeff King
On Mon, Aug 15, 2016 at 03:48:55PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > The simple fix is to call register_tempfile() in open_pack_file(), and > > just have index-pack clean up the file on its way out. > > > > But there are harder cases. For instance, imagine somebody pushes a

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

2016-08-15 Thread Junio C Hamano
Jeff King writes: > The simple fix is to call register_tempfile() in open_pack_file(), and > just have index-pack clean up the file on its way out. > > But there are harder cases. For instance, imagine somebody pushes a > 500MB file, and you have a pre-receive hook that says "too big; I won't > a

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

2016-08-15 Thread Jeff King
On Mon, Aug 15, 2016 at 09:57:29PM +0200, Christian Couder wrote: > From: Jeff King > > Receive-pack feeds its input to either index-pack or > unpack-objects, which will happily accept as many bytes as > a sender is willing to provide. Let's allow an arbitrary > cutoff point where we will stop w

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

2016-08-15 Thread Christian Couder
From: Jeff King Receive-pack feeds its input to either index-pack or unpack-objects, which will happily accept as many bytes as a sender is willing to provide. Let's allow an arbitrary cutoff point where we will stop writing bytes to disk. What has already been written to disk can be cleaned out