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

init --shared=0666 isn't

From
SFSteve Folly <steve@spfweb.co.uk>
Date
Mar 9, 2010, 22:31 UTC
Message-ID
<loom.20100309T224207-485@post.gmane.org>
Using git 1.7.0.2 on Mac OS X 10.6.2:
$ git init --bare --shared=0666 /tmp/shared.git
$ git --git-dir=/tmp/shared.git remote add --mirror \
        origin git://git.kernel.org/pub/scm/git/git.git
$ git --git-dir=/tmp/shared.git fetch origin
# login as someone else; different uid, different gid, then:
$ git --git-dir=/tmp/shared.git fetch origin
error: cannot open /tmp/shared.git/FETCH_HEAD: Permission denied
FETCH_HEAD is owned by the original user, with 0644 permissions,
 not 0666 as originally requested.
I've only had a quick glance at the source - my first guess
 is that in builtin-fetch.c, store_updated_refs and 
truncate_fetch_head should call adjust_shared_perm after
closing the file being written? Or, should an empty FETCH_HEAD
with appropriate shared perms be written during init?
In my case I'm using /tmp/shared.git as a mirror for other
 local repositories init'ed with --reference=/path/to/mirror.git
and all I'll be doing if fetching into it periodically, so I think fixing 
FETCH_HEAD will suffice for me. 

But, I wonder if there are other files written that will need fixing also - ORIG_HEAD, MERGE_HEAD?

Is there a workaround for this or am I doing something wrong? Thanks for any help.

Regards, Steve

Next: Junio C Hamano
Message 1 of 2 in “init --shared=0666 isn't”
  1. Steve FollyMar 9, 2010
  2. Junio C HamanoMar 9, 2010

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.