git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "CHIGOT, CLEMENT" <clement.chigot@atos.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] git-compat-util: work around for access(X_OK) under root
Date: Tue, 23 Apr 2019 23:55:26 +0000	[thread overview]
Message-ID: <20190423235526.GF6316@genre.crustytoothpaste.net> (raw)
In-Reply-To: <AM6PR02MB495010DED643EC262D116DD0EA230@AM6PR02MB4950.eurprd02.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]

On Tue, Apr 23, 2019 at 11:31:02AM +0000, CHIGOT, CLEMENT wrote:
> From: Junio C Hamano <jch2355@gmail.com> on behalf of Junio C Hamano <gitster@pobox.com>
> This patch is needed in order to have hooks working on AIX. When run as root,
> access on hooks will return true even if a hook can't be executed. Therefore,
> as far as I know, git will try to execute it as is and we'll get this kind of
> error:
> "git commit -m content
>  fatal: cannot exec '.git/hooks/pre-commit': Permission denied"

I think this is the interesting part.

What POSIX says on this is the following:

  If any access permissions are checked, each shall be checked
  individually, as described in XBD File Access Permissions, except that
  where that description refers to execute permission for a process with
  appropriate privileges, an implementation may indicate success for
  X_OK even if execute permission is not granted to any user.

The XBD File Access Permissions text says:

  If a process has appropriate privileges:
    […]
    If execute permission is requested, access shall be granted if
    execute permission is granted to at least one user by the file
    permission bits or by an alternate access control mechanism;
    otherwise, access shall be denied.

I believe that's what's occurring here. Your commit message, however,
should contain some text that explains that AIX takes this liberty
provided by POSIX, and why that causes problems for Git (i.e., what
problems the user will see). Ideally, the reader of the commit message
will know the relevant details about this issue from your commit message
without needing to consult the standard itself.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

  reply	other threads:[~2019-04-23 23:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23  8:38 [PATCH] git-compat-util: work around for access(X_OK) under root CHIGOT, CLEMENT
2019-04-23 10:11 ` Duy Nguyen
2019-04-23 10:32 ` Junio C Hamano
2019-04-23 11:31   ` CHIGOT, CLEMENT
2019-04-23 23:55     ` brian m. carlson [this message]
2019-04-24  0:55       ` Junio C Hamano
2019-04-24  1:16         ` brian m. carlson
2019-04-24  0:48     ` Junio C Hamano
2019-04-24  7:54       ` CHIGOT, CLEMENT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190423235526.GF6316@genre.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=clement.chigot@atos.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).