git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git submodule: update=!command
@ 2015-03-17 19:28 Ryan Lortie
  2015-03-17 19:50 ` Jeff King
  2015-03-17 20:49 ` Junio C Hamano
  0 siblings, 2 replies; 10+ messages in thread
From: Ryan Lortie @ 2015-03-17 19:28 UTC (permalink / raw)
  To: git; +Cc: Chris Packham, Junio C Hamano

karaj,

'man git-submodule' contains mention (in one place) that:

    Setting the key submodule.$name.update to !command
    will cause command to be run.

This is not documented in 'man gitmodules' (which documents the other
possible values for the 'update' key) nor in 'man git-config' which also
mentions the 'update' key (but refers readers to the two other pages).

This feature is scary.  The idea that arbitrary code could be executed
on my machine when I run innocent-looking git commands, based on the
content of the .gitmodules file is enough to  give pause to anybody.

Fortunately, it seems that (for now?) this is not really the case.  'git
submodule init' will copy the values of the 'update' key from
.gitmodules to your local git config, but only if they are one of
"none", "checkout", "merge" or "rebase".

So, I guess I'm asking two things.

The first is a question about git's basic policy with respect to things
like this.  I hope that it's safe to assume that running 'git' commands
on repositories downloaded from potentially-hostile places will never
result in the authors of those repositories being able to run code on my
machine.

If that is true then, the second request would be to spell this out more
explicitly in the relevant documentation.  I'm happy to write a patch to
do that, if it is deemed appropriate.

Thanks in advance.

Cheers

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-03-18  7:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 19:28 git submodule: update=!command Ryan Lortie
2015-03-17 19:50 ` Jeff King
2015-03-17 20:48   ` Ryan Lortie
2015-03-18  7:38   ` Chris Packham
2015-03-17 20:49 ` Junio C Hamano
2015-03-17 20:59   ` Ryan Lortie
2015-03-17 21:05     ` Junio C Hamano
2015-03-17 21:11       ` Ryan Lortie
2015-03-18  7:43       ` Chris Packham
2015-03-18  7:45         ` Chris Packham

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 NNTP newsgroup(s).