<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/compat/access.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-04-25T08:49:44Z</updated>
<entry>
<title>git-compat-util: work around for access(X_OK) under root</title>
<updated>2019-04-25T08:49:44Z</updated>
<author>
<name>Clément Chigot</name>
<email>clement.chigot@atos.net</email>
</author>
<published>2019-04-25T07:01:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=400caafb2bb63712bb23cfa4d800261aab8e5cae'/>
<id>urn:sha1:400caafb2bb63712bb23cfa4d800261aab8e5cae</id>
<content type='text'>
On AIX, access(X_OK) may succeed when run as root even if the
execution isn't possible. This behavior is allowed by POSIX
which says:

  ... for a process with appropriate privileges, an implementation
  may indicate success for X_OK even if execute permission is not
  granted to any user.

It can lead hook programs to have their execution refused:

   git commit -m content
   fatal: cannot exec '.git/hooks/pre-commit': Permission denied

Add NEED_ACCESS_ROOT_HANDLER in order to use an access helper function.
It checks with stat if any executable flags is set when the current user
is root.

Signed-off-by: Clément Chigot &lt;clement.chigot@atos.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
