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
Junio C Hamano <gitster@pobox.com>
Date
Feb 18, 2015, 17:31 UTC
Message-ID
<xmqqy4nv2kjk.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqq4mqj3zyx.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 21 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> in compat/broken-unlink.c and something like this
>>>
>>> 	#ifdef BROKEN_UNLINK
>>> 	#define unlink(x) workaround_broken_unlink(x)
>>>         #endif
>>>
>>> in git-compat-util.h instead? 
>>
>> That means we have to know BROKEN_UNLINK at compile-time. I had never
>> heard about AFP before this thread, but they seem mountable on Linux and
>> Windows. I don't know whether these platforms will have the same issue,
>> but I suspect they will (if the server rejects the unlink).
>>
>> So, if my suspicion is right, we'd have to activate it on any platform
>> able to mount AFP, i.e. essentially everywhere.
>
> Sigh.
That is "Sigh.  It is unfortunate but you are correct.".
Perhaps we would need to do something ugly like this:
 * add "core.brokenUnlink" configuration (or whatever we end up
   calling this filesystem trait) and add "int broken_unlink" in
   environment.c (declare it in cache.h).
 * in init-db.c, autoprobe by doing something like this:
    create a test file with 0444 permission bits;
    if (unlink(that test file)) {
	chmod(that test file, 0644);
        if (!unlink(that test file)) {
		broken_unlink = 1;
		git_config_set("core.brokenunlink", broken_unlink);
	} else {
        	die("aaargh");
	}
    }
 * Do your unlink_or_chmod() thing in wrapper.c, but perhaps call it
   xunlink(), like this:
        int xunlink(...) {
		int ret = unlink(...);
		if (broken_unlink && ret) {
                        chmod(..., 0644);
                        ret = unlink(...);
                }
                return ret;
        }
We probably need something similar for xrename()?
	
Previous: Junio C HamanoNext: brian m. carlson
Message 18 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.