On Fri, 09 Dec 2011 18:23:50 +0100, Junio C Hamano <gitster@xxxxxxxxx>
wrote:
"Frans Klaver" <fransklaver@xxxxxxxxx> writes:
Wouldn't access(2) with R_OK|X_OK give you exactly what you want
without
this much trouble?
I just had a good look through the man page of access(2), and I think
it depends. access works for the real uid, which is what I attempted
to implement in the above check as well. However, do we actually need
to use the real uid or do we need the set uid (geteuid(2))?
Does it matter? We do not use seteuid or setegid ourselves and we do not
expect to be installed as owned by root with u+s bit set.
That's what I thought, but needed to know for sure that this was the case.
access(2) checks with real uid exactly because it would not make a
difference to normal user level programs _and_ it makes it easier for a
suid programs to check with the real identity, and our use case falls
into the former, no?
Certainly looks like. Thanks. I'll reroll somewhere next week.
Frans
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html