Re: odb_mkstemp's 0444 permission broke write/delete access on AFP
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 17, 2015, 17:13 UTC
- Message-ID
- <xmqqwq3g31hj.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <vpqr3tozzs5.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 9 quoted lines
> This should be fixable from Git itself, by replacing the calls to
> "unlink" with something like
>
> int unlink_or_chmod(...) {
> if (unlink(...)) {
> chmod(...); // give user write permission
> return unlink(...);
> }
> }I agree with the approach in principle, but I wonder if we want to contaminate the generic codepath with unlink_or_chmod().
Don't we want to have this
#undef unlink
int workaround_broken_unlink(...) {
... the same ...
}in compat/broken-unlink.c and something like this
#ifdef BROKEN_UNLINK
#define unlink(x) workaround_broken_unlink(x)
#endifin git-compat-util.h instead? That way, people on well behaving systems do not have to worry about clobbering errno and stuff, perhaps?