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

Re: [RFC] Secure central repositories by UNIX socket authentication

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 27, 2008, 14:04 UTC
Message-ID
<alpine.LSU.1.00.0801271402330.23907@racer.site>
In-Reply-To
<20080127103934.GA2735@spearce.org>
Hi,
On Sun, 27 Jan 2008, Shawn O. Pearce wrote:
Show 23 quoted lines
>     ## Owner (not jdoe)
>     ##
>   cat >foo.git/hooks/update <<'EOF'
>   #!/bin/sh
>   test -z "$GIT_REMOTE_USER" || exit
>   case "$GIT_REMOTE_USER" in
>   jdoe)     exit 0;;
>   spearce)  exit 0;;
>   *)        exit 1
>   esac
>   EOF
>   chmod u+x foo.git/hooks/update
>   chmod 700 foo.git
> 
>   git daemon \
>       --export-all \
>       --enable=receive-pack \
>       --base=`pwd` \
>       --listen=/tmp/shawn-git
> 
>     ## Other User
>     ##
>   git push jdoe@server:/tmp/shawn-git/foo.git master

I probably miss something, but if you already go through SSH, the $USER is set appropriately, no?

So you could do without git-daemon entirely, and replace the GIT_REMOTE_USER variable in the hook by USER.

Ciao, Dscho

Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 2 of 16 in “[RFC] Secure central repositories by UNIX socket authentication”
  1. Shawn O. PearceJan 27, 2008
  2. Johannes SchindelinJan 27, 2008
  3. Shawn O. PearceJan 27, 2008
  4. Johannes SchindelinJan 27, 2008
  5. Shawn O. PearceJan 28, 2008
  6. Dmitry PotapovJan 28, 2008
  7. Junio C HamanoJan 27, 2008
  8. git-daemon is insecure? (was: [RFC] Secure central repositories)Shawn O. Pearce, Jan 28, 2008
  9. Junio C HamanoJan 28, 2008
  10. Shawn O. PearceJan 28, 2008
  11. Shawn O. PearceJan 28, 2008
  12. Junio C HamanoJan 28, 2008
  13. Shawn O. PearceJan 28, 2008
  14. Asheesh LaroiaJan 28, 2008
  15. Shawn O. PearceJan 29, 2008
  16. Shawn O. PearceJan 28, 2008

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.