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

Re: [PATCH] git-receive-pack needs to set umask(2)

From
SZSalikh Zakirov <salikh.zakirov@intel.com>
Date
May 29, 2006, 11:28 UTC
Message-ID
<447ADAEF.3030806@Intel.com>
In-Reply-To
<Pine.LNX.4.63.0605290910210.8863@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
> See also
> 
> http://thread.gmane.org/gmane.comp.version-control.git/13856/focus=13876
I've read the thread, but couldn't find a practical solution there.
 
Show 5 quoted lines
> The essence of the thread: If you want to do anything useful in a non-bare 
> repository, you are likely using other tools than git, which do not 
> interpret core.umask or $GIT_DIR/umask.
> 
> If you use a bare repository, just make it shared. No need for an umask.
Could you please elaborate on what does it mean "make it shared"?

My setup: I have a bare GIT repository on a machine, where everybody can SSH into (with full shell access). I've assigned the repo to a special group where everybody belongs, and done a 'find repo.git -type d | xargs chmod 2775'

The problem: After someone pushed to the repository, the object directories (i.e repo.git/objects/??) get created with 755 access rights, and effectively prevent everyone else from pushing objects starting with the same prefix.

The obvious solution to use umask 002 is not applicable, because
1) It does not seem practical to enforce umask 002 in everyone's rc files, 
because just one forgetful or careless person can break access for all others
2) I have 'umask 002' in my ~/.profile. Somehow, it does not help,
because ~/.profile is not read on non-interactive SSH sessions
(to verify that, just try to do 'ssh somehost umask')

The current workaround for the problem is a cron script, which makes 'find | xargs chmod 2775' every 5 minutes. It works, but is ugly.

Is there any better way to keep correct access rights in a shared repository?
Thanks a lot!
Previous: Johannes SchindelinNext: Shawn Pearce
Message 4 of 9 in “git-receive-pack needs to set umask(2)”
  1. git-receive-pack needs to set umask(2)Michael Richardson, May 28, 2006
  2. Jakub NarebskiMay 28, 2006
  3. Johannes SchindelinMay 29, 2006
  4. Salikh ZakirovMay 29, 2006
  5. Shawn PearceMay 29, 2006
  6. Linus TorvaldsMay 29, 2006
  7. Alex RiesenMay 29, 2006
  8. Johannes SchindelinMay 29, 2006
  9. Petr BaudisMay 28, 2006

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.