Re: Question regarding UNIX access() call
- From: Casper H.S. Dik <Casper.Dik@xxxxxxx>
- Date: 01 Aug 2007 17:18:10 GMT
Fantoosh B <fantooshb@xxxxxxxxx> writes:
I was wondering if there is a function similar to access(2), but one
that uses *effective* userid and groupid rather than *real*?
Not a standard one. (Solaris, e.g., has eaccess() in a separate library
and a secret "E_OK" flag which you can or in to the access flags)
For instance, in order to test whether the process has execute
permissions on the file I can call access(file, X_OK). However, I want
to check if my effective UID/GID and supplementary groups allow me to
execute this file. How can I do this kind of check?
I can certainly read the access control list using libacl, but I
guess there must be simpler way to do it.
You are approaching this incorrectly because you can never be sure
you can execute a program before you actually executed it.
Is there any reason why you can't "just do it"?
Casper
.
- Follow-Ups:
- Re: Question regarding UNIX access() call
- From: Fantoosh B
- Re: Question regarding UNIX access() call
- References:
- Question regarding UNIX access() call
- From: Fantoosh B
- Question regarding UNIX access() call
- Prev by Date: Re: Problem with fork()
- Next by Date: Re: strange csh script behavior only in certain account
- Previous by thread: Re: Question regarding UNIX access() call
- Next by thread: Re: Question regarding UNIX access() call
- Index(es):
Relevant Pages
|