Re: [PATCH] fcntl.h: define AT_EACCESS

From: maximilian attems
Date: Mon Apr 19 2010 - 18:05:15 EST


On Mon, Apr 19, 2010 at 02:47:29PM -0700, Andrew Morton wrote:
> On Fri, 16 Apr 2010 05:08:00 +0200
> maximilian attems <max@xxxxxxx> wrote:
>
> > noticed on a klibc build of dash that someone had left out that def:
> > usr/dash/bltin/test.c:490: error: ___AT_EACCESS___ undeclared (first use in thiction)
> >
> > Cc: stable@xxxxxxxxxx
> > Cc: Ulrich Drepper <drepper@xxxxxxxxxx>
> > Cc: H. Peter Anvin <hpa@xxxxxxxxx>
> > Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> > Signed-off-by: maximilian attems <max@xxxxxxx>
> > ---
> > include/linux/fcntl.h | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
> > index 8603740..8bb001d 100644
> > --- a/include/linux/fcntl.h
> > +++ b/include/linux/fcntl.h
> > @@ -39,6 +39,8 @@
> > #define AT_REMOVEDIR 0x200 /* Remove directory instead of
> > unlinking file. */
> > #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
> > +#define AT_EACCESS 0x200 /* Test access permitted for
> > + effective IDs, not real IDs. */
> >
>
> I'm all confused.
>
> The affects sys_faccesat(), yes? But sys_faccesat() never gets passed
> a `flags' argument so how does the behaviour which the FACCESSAT(2)
> manpage describes get implemented?
>
> This patch doesn't actually change kernel behaviour, so how can setting
> AT_EACCESS change any syscall's actions?
>
> It's a bit of a worry that the proposed value for AT_EACCESS duplicates
> AT_REMOVEDIR. I guess that, despite apeparances, they're different
> namespaces. Any thoughts on the implications of this?

glibc fcntl.h defines AT_EACCESS in the same way as aboves patch,
concerning the implementation, others should know better.

the dash code calling faccessat has the 4 params,
klibc faccessat had only 3 args, guess nobody had used it before.

the relevant dash code reads:
#ifdef HAVE_FACCESSAT
static int test_file_access(const char *path, int mode)
{
return !faccessat(AT_FDCWD, path, mode, AT_EACCESS);
}
#else /* HAVE_FACCESSAT */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/