git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Jeff Hostetler <git@jeffhostetler.com>, git <git@vger.kernel.org>,
	Jeff Hostetler <jeffhost@microsoft.com>,
	Jonathan Tan <jonathantanmy@google.com>,
	Matthew DeVore <matvore@google.com>
Subject: Re: how does "clone --filter=sparse:path" work?
Date: Fri, 24 May 2019 11:27:31 +0200	[thread overview]
Message-ID: <CAP8UFD3bVH5w=DeMi8R=_O=oyatWj8coh_MxT4kTyJyp1+pOMw@mail.gmail.com> (raw)
In-Reply-To: <20190524083142.GC9082@sigill.intra.peff.net>

On Fri, May 24, 2019 at 10:31 AM Jeff King <peff@peff.net> wrote:
>
> On Fri, May 24, 2019 at 10:05:45AM +0200, Christian Couder wrote:

> > The way I see it could be restricted is by adding a config option on
> > the server, maybe called "uploadpack.sparsePathFilter", to tell which
> > filenames can be accessed using "--filter=sparse:path=".
> >
> > For example with uploadpack.sparsePathFilter set to
> > "/home/user/git/sparse/*" and "--filter=sparse:path=foo" then
> > "/home/user/git/sparse/foo" on the server would be used if it exists.
> > (Of course care should be taken that things like
> > "--filter=sparse:path=bar/../../foo" are rejected.)
> >
> > If uploadpack.sparsePathFilter is unset or set to "false", then
> > "--filter=sparse:path=<stuff>" would always error out.
> >
> > Is this what you had in mind?
>
> My plan had been to disallow it entirely, and allow some mechanism by
> which the client could specify the actual set of sparse paths itself
> (which it might get from a local file, or communicated in some
> out-of-band way to the user cloning, etc).

I think that indeed disallowing "sparse:path" is the simplest and
safest way to go. And I agree that a "mechanism by which the client
could specify the actual set of sparse paths itself" would be really
nice. I think it might be more complex and take a significant amount
of time to implement though.

> If we just want a mechanism for the server to provide a pre-made sparse
> list, then I think pointing people at sparse:oid=<blob> is simpler
> there. I.e., your "foo" becomes "refs/sparse/foo" or even "HEAD:.sparse"
> or similar, and the server admin just sticks the content into the repo
> instead of dealing with exposing filesystem paths to the client.

I agree that it is simpler to just use "sparse:oid" which already
works. I just thought that some servers might want to provide pre-made
sparse lists that aren't in the repo so that client cannot possibly
change them (by pushing into the repo), and that "sparse:path" could
be used for that purpose.

Now if no one is currently interested in providing pre-made sparse
lists that aren't in the repo, then I am ok to just disable
"sparse:path" for now, and I might send a patch to do it soon. It will
at least fix the security issue with "sparse:path" and thus enable
people interested in using "sparse:oid" to start doing so (without
opening a big security hole).

      reply	other threads:[~2019-05-24  9:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08  5:07 how does "clone --filter=sparse:path" work? Jeff King
2018-11-08 18:57 ` Jeff Hostetler
2018-11-22 17:39   ` Jeff King
2019-05-24  8:05     ` Christian Couder
2019-05-24  8:31       ` Jeff King
2019-05-24  9:27         ` Christian Couder [this message]

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='CAP8UFD3bVH5w=DeMi8R=_O=oyatWj8coh_MxT4kTyJyp1+pOMw@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=jeffhost@microsoft.com \
    --cc=jonathantanmy@google.com \
    --cc=matvore@google.com \
    --cc=peff@peff.net \
    /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).