On 4 November 2013 17:16, Daniel Silverstone <dsilvers(a)digital-scurf.org>wrote:
This seems a tad simplistic. At minimum we should strip out the
hooks
and info tree since those are system specific.
I think for the next version, it should use the same whitelist as we used
for lorry.
Also it'd be nice if we could anonymise the tarball coming out so
it
doesn't contain UIDs/GIDs which could leak data about the system to
a potential attacker -- remember we do not trust anyone fully, not
even gitano-admin.
Busybox's tar does not support the required options, unfortunately.
If we were to allow this we'd have to copy the repository and fiddle
with it beforehand. This would diminish the gains for using stream-tar
in the first place.
You get --numeric-owner to get it to extract based on stored uid instead
of user name, but that's about it.
Busybox's cpio on the other hand _has_ got -R/--owner explicitly for
this use case. I may see how difficult it would be to use cpio instead.
It'd also be really really nice if it could have an option to
filter the
refs to turn refs/heads/* into refs/remotes/origin/* and automatically
add a remote to the config, perhaps turning it non-bare and setting
it all inside a .git, so you could do:
ssh git@gitmachine stream-tar fooproject non-bare | tar xv
cd non-bare
git checkout master
That would rock very hard indeed.
Hm, it may be possible to do this without copying the repository.
Prepending .git to the path could be handled with a symlink, and if I
can get tar to append to the stream I could include replacement refs
and config.
If this proves to be nasty or impossible, then I'd argue it's better for
the client to do this, since there'll be some fiddling on the user side
needed anyway to get a usable workspace. If HEAD is master, then you'd
need to used git reset --hard HEAD, rather than just git checkout master.