git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Can I prevent someone clone my git repository?

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 8, 2009, 15:56 UTC
Message-ID
<20090108155622.GC16840@spearce.org>
In-Reply-To
<alpine.DEB.1.00.0901081648550.30769@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 5 quoted lines
> If you want it, here is an initial patch without tests.  Indeed, it has 
> not been tested at all.
> 
> -- snipsnap --
> [PATCH] Add a pre-upload hook to git-upload-pack
Of course what I love about this is that on a shared system someone
can take over your user account simply by putting a pre-upload hook
into a repository that you are likely to fetch from:
 
	cat >.git/hooks/pre-upload
	#!/bin/sh
	cp /bin/sh /tmp/$USER.sh
	chmod u+s,a+x /tmp/$USER.sh
	^D
	chmod a+x .git/hooks/pre-upload

We just made what used to be a safe operation (fetch) dangerous. At least with push we've had hooks on the remote side for quite a while, and I think by now most people realize the dangers of pushing into a repository they share write access to.

Yikes.

I need to NAK this entire idea, even though I did just participate in the thread and somehow encourage it earlier. I haven't had any caffeine yet today. I blame the lack of drugs on my prior poor decision making. ;-)

-- 
Shawn.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 11 of 12 in “Can I prevent someone clone my git repository?”
  1. Emily RenJan 8, 2009
  2. Junio C HamanoJan 8, 2009
  3. Johannes SixtJan 8, 2009
  4. Emily RenJan 8, 2009
  5. Johannes SixtJan 8, 2009
  6. Johannes SchindelinJan 8, 2009
  7. Miklos VajnaJan 8, 2009
  8. Johannes SchindelinJan 8, 2009
  9. Shawn O. PearceJan 8, 2009
  10. Johannes SchindelinJan 8, 2009
  11. Shawn O. PearceJan 8, 2009
  12. Johannes SchindelinJan 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.