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

Re: [PATCH v2 1/3] read-cache: use shared perms when writing shared index

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 25, 2017, 04:42 UTC
Message-ID
<CAP8UFD24RMxjWzowP7-LD5ZA+usNaHzr=1tzP4BNTUziqYF4_w@mail.gmail.com>
In-Reply-To
<xmqq60fmcqgm.fsf@gitster.mtv.corp.google.com>
On Sat, Jun 24, 2017 at 12:02 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian Couder <christian.couder@gmail.com> writes:
Show 22 quoted lines
>> Because of that, on repositories created with `git init --shared=all`
>> and using the split index feature, one gets an error like:
>>
>> fatal: .git/sharedindex.a52f910b489bc462f187ab572ba0086f7b5157de: index file open failed: Permission denied
>>
>> when another user performs any operation that reads the shared index.
>>
>> We could use create_tempfile() that calls adjust_shared_perm(), but
>> unfortunately create_tempfile() doesn't replace the XXXXXX at the end
>> of the path it is passed. So let's just call adjust_shared_perm() by
>> ourselves.
>
> Because create_tempfile() is not even a viable alternative, the
> above sounds just as silly as saying "We could use X, but
> unfortunately that X doesn't create a temporary file and return its
> file descriptor" with X replaced with any one of about a dozen
> functions that happen to call adjust_shared_perm().
>
>         Call adjust_shared_perm() on the temporary file created by
>         mks_tempfile() ourselves to adjust the permission bits.
>
> should be sufficient.

Ok, the v3 has the above in the commit message and also uses get_tempfile_path().

Previous: Junio C Hamano
Message 8 of 8 in “read-cache: use shared perms when writing shared index”
  1. 1/3 read-cache: use shared perms when writing shared indexChristian Couder, Jun 23, 2017
  2. 2/3 t1301: move modebits() to test-lib-functions.shChristian Couder, Jun 23, 2017
  3. 3/3 t1700: make sure split-index respects core.sharedrepositoryChristian Couder, Jun 23, 2017
  4. Junio C HamanoJun 23, 2017
  5. Christian CouderJun 25, 2017
  6. Junio C HamanoJun 23, 2017
  7. Junio C HamanoJun 23, 2017
  8. Christian CouderJun 25, 2017

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.