Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:50

Matthieu Moy [off-list ref] writes:
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)
        #endif

in git-compat-util.h instead?  That way, people on well behaving
systems do not have to worry about clobbering errno and stuff,
perhaps?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help