Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-24 Thread CHIGOT, CLEMENT
From: Junio C Hamano on behalf of Junio C Hamano > "CHIGOT, CLEMENT" writes: > > From: Junio C Hamano on behalf of Junio C Hamano > > > >> > On some OSes like AIX, access with X_OK is always true if launched under > >> > root. > >> > >> That may be the case, but you'd need to describe why it

Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread brian m. carlson
On Wed, Apr 24, 2019 at 09:55:04AM +0900, Junio C Hamano wrote: > "brian m. carlson" writes: > > > 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 > > wh

Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread Junio C Hamano
"brian m. carlson" writes: > 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 > appro

Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread Junio C Hamano
"CHIGOT, CLEMENT" writes: > From: Junio C Hamano on behalf of Junio C Hamano > >> > On some OSes like AIX, access with X_OK is always true if launched under >> > root. >> >> That may be the case, but you'd need to describe why it is a problem >> here, before talking about the need for a "work

Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread brian m. carlson
On Tue, Apr 23, 2019 at 11:31:02AM +, CHIGOT, CLEMENT wrote: > From: Junio C Hamano on behalf of Junio C Hamano > > 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

Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread CHIGOT, CLEMENT
From: Junio C Hamano on behalf of Junio C Hamano > > On some OSes like AIX, access with X_OK is always true if launched under > > root. > > That may be the case, but you'd need to describe why it is a problem > here, before talking about the need for a "work around". > > For example, if a dire

Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread Junio C Hamano
"CHIGOT, CLEMENT" writes: > On some OSes like AIX, access with X_OK is always true if launched under > root. That may be the case, but you'd need to describe why it is a problem here, before talking about the need for a "work around". For example, if a directory on $PATH has a file called git-f

Re: [PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread Duy Nguyen
On Tue, Apr 23, 2019 at 3:41 PM CHIGOT, CLEMENT wrote: > > On some OSes like AIX, access with X_OK is always true if launched under > root. > 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

[PATCH] git-compat-util: work around for access(X_OK) under root

2019-04-23 Thread CHIGOT, CLEMENT
On some OSes like AIX, access with X_OK is always true if launched under root. 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 --- Makefile | 8 ++