Re: [PATCH 1/2] run-command: Add checks after execvp fails with EACCES
- From
Frans Klaver <fransklaver@gmail.com>
- Date
- Dec 14, 2011, 22:06 UTC
- Message-ID
- <op.v6h2cwuw0aolir@keputer.lokaal>
- In-Reply-To
- <CAH6sp9Mf=EjkVN9mDN59ZCxCU0sCFLa8E=7YxM1J8LCCMr=xYQ@mail.gmail.com>
On Wed, 14 Dec 2011 15:31:25 +0100, Frans Klaver <fransklaver@gmail.com> wrote:
Show 6 quoted lines
> Since fopen() uses the effective uid/gid, it then makes sense to use > eaccess(3) instead of access(2) if available. It would be stupid to > have bugs arise just because of a mismatch between the [ug]ids used by > the two access checks. I'm aware of the fact that eaccess isn't a > standard function, so a #define HAVE... fallback to at least access() > would probably be required.
Just to be clear, I don't really want to restart the discussion of which uid to use, but it is something to consider now or in the future. The next roll will use access(2) as far as I'm concerned.