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

Re: odb_mkstemp's 0444 permission broke write/delete access on AFP

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Feb 16, 2015, 18:23 UTC
Message-ID
<vpqtwyl90mx.fsf@anie.imag.fr>
In-Reply-To
<A403BFCC-D66F-49BD-B54C-BB86B467F1A1@gmail.com>
Fairuzan Roslan <fairuzan.roslan@gmail.com> writes:
Show 5 quoted lines
> Hi,
>
> Somehow the “int mode = 0444;” in odb_mkstemp (environment.c) are
> causing a lot of issues (unable to unlink/write/rename) to those
> people who use AFP shares.

Is it a problem when using Git (like "git gc" failing to remove old packs), or when trying to remove files outside Git?

> The issue was first introduced in
> https://github.com/git/git/blob/f80c7ae8fe9c0f3ce93c96a2dccaba34e456e33a/wrapper.c
> line 284.

I don't think so. The code before this commit did essentially a chmod 444 on the file, so object files were already read-only before.

The pack files have been read-only since d83c9af5c6a437ddaa9dd27 (Junio, Apr 22 2007).

> To fix these issues the permission need to be adjusted to “int mode =
> 0644;” in odb_mkstemp (environment.c)

The issue is that having object and pack files read-only on the filesystem is a safety feature to prevent accidental modifications (even though it's actually not that effective, since brute-force "sed -i" or "perl -i" still accept to modify read-only files).

So, I'd be a bit reluctant to remove this safety feature for all users if it's only for the benefit of a minority of users. Not that I think the problem shouldn't be fixed, but I'd rather investigate alternate solutions before using this mode = 0644.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Fairuzan RoslanNext: Fairuzan Roslan
Message 2 of 22 in “odb_mkstemp's 0444 permission broke write/delete access on AFP”
  1. Fairuzan RoslanFeb 16, 2015
  2. Matthieu MoyFeb 16, 2015
  3. Fairuzan RoslanFeb 16, 2015
  4. Matthieu MoyFeb 16, 2015
  5. Fairuzan RoslanFeb 17, 2015
  6. Torsten BögershausenFeb 17, 2015
  7. Fairuzan RoslanFeb 17, 2015
  8. Matthieu MoyFeb 17, 2015
  9. Fairuzan RoslanFeb 17, 2015
  10. Torsten BögershausenFeb 17, 2015
  11. Matthieu MoyFeb 18, 2015
  12. Fairuzan RoslanFeb 18, 2015
  13. Matthieu MoyFeb 18, 2015
  14. Fairuzan RoslanFeb 18, 2015
  15. Junio C HamanoFeb 17, 2015
  16. Matthieu MoyFeb 18, 2015
  17. Junio C HamanoFeb 18, 2015
  18. Junio C HamanoFeb 18, 2015
  19. brian m. carlsonFeb 19, 2015
  20. Matthieu MoyFeb 20, 2015
  21. Junio C HamanoFeb 16, 2015
  22. Torsten BögershausenFeb 16, 2015

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.