Re: Question regarding UNIX access() call



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
.



Relevant Pages

  • Re: DO - WHILE loop in matlab?
    ... It has to do with end effects and termination tests. ... I know that I need to execute the body at least once, ... The while-do loop on the other hand, ... while flag ...
    (comp.soft-sys.matlab)
  • Re: which book to start with...?
    ... The CPU *would* execute it, ... find that Nasm puts its name in a .comment section...). ... but i dont understand how the previous test will set the sign flag. ... Not a bad idea - I find Nasm's version of the instruction set reference useful, even though it isn't up-to-date. ...
    (alt.lang.asm)
  • Re: Determining whether an applications has thrown some error ...
    ... set some flag and check the flag whether error is thrown or not ... ... It depends on where the error happens and what type it is versus where you want to execute the code. ... If the error is an exception (as your use of the word "thrown" implies) you can put the code in a catch block and it will execute "immediately" after the error is thrown (depending on the rest of the code). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Looping in MS SQL 2000 DTS
    ... i think this behaviour and your code is correct, only the flag does not ... 'Set oPkg = DTSGlobalVariables.Parent ... 'Do not execute task 2, ... times trough that should not really be a replacement for sleep. ...
    (microsoft.public.sqlserver.dts)
  • Re: NAT:Great Blog for Stephen
    ... I bet that unfurls 'your' flag! ... Time to reveal why you're still claiming to be "single":http://tinyurl.com/yam5ht ... Damn, our little secret is out, sweetie pie. ...
    (rec.audio.opinion)