[RFC PATCH 0/2] upload-pack.c: limit allowed filter choices
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Mar 17, 2020, 20:39 UTC
- Message-ID
- <cover.1584477196.git.me@ttaylorr.com>
- In-Reply-To
- <CAP8UFD0wJo4onz0_Vw4-bcX1h61=J=ZiKfM-fMXLj4B9q0aveg@mail.gmail.com>
Hi Christian,
Of course, I would be happy to send along our patches. They are included in the series below, and correspond roughly to what we are running at GitHub. (For us, there have been a few more clean-ups and additional patches, but I squashed them into 2/2 below).
The approach is roughly that we have:
- 'uploadpack.filter.allow' -> specifying the default for unspecified
filter choices, itself defaulting to true in order to maintain
backwards compatibility, and - 'uploadpack.filter.<filter>.allow' -> specifying whether or not each
filter kind is allowed or not. (Originally this was given as 'git
config uploadpack.filter=blob:none.allow true', but this '=' is
ambiguous to configuration given over '-c', which itself uses an '='
to separate keys from values.)I noted in the second patch that there is the unfortunate possibility of encountering a SIGPIPE when trying to write the ERR sideband back to a client who requested a non-supported filter. Peff and I have had some discussion off-list about resurrecting SZEDZER's work which makes room in the buffer by reading one packet back from the client when the server encounters a SIGPIPE. It is for this reason that I am marking the series as 'RFC'.
For reference, our configuration at GitHub looks something like:
[uploadpack]
allowAnySHA1InWant = true
allowFilter = true
[uploadpack "filter"]
allow = false
[uploadpack "filter.blob:limit"]
allow = true
[uploadpack "filter.blob:none"]
allow = truewith a few irrelevant details elided for the purposes of the list :-).
I'd be happy to take in any comments that you or others might have before dropping the 'RFC' status.
Taylor Blau (2): list_objects_filter_options: introduce 'list_object_filter_config_name' upload-pack.c: allow banning certain object filter(s)
Documentation/config/uploadpack.txt | 12 ++++++ list-objects-filter-options.c | 25 +++++++++++ list-objects-filter-options.h | 6 +++ t/t5616-partial-clone.sh | 23 ++++++++++ upload-pack.c | 67 +++++++++++++++++++++++++++++ 5 files changed, 133 insertions(+)
-- 2.26.0.rc2.2.g888d9484cf