Re: [EXIM] require_files and execution (Procmail IFS error r…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Philip Hazel
日付:  
To: exim-users
題目: Re: [EXIM] require_files and execution (Procmail IFS error resolved!)
On Fri 04 Sep, Peter Radcliffe wrote:

> I want to know if the path is a file executable by the user doing the
> check.


How can it tell? If you discover from stat() that a file has permissions
r-xr-xr-- can you execute it or not?

Somebody mentioned access(2). Unfortunately, this doesn't do what you
want, at least not according to the man page on Solaris 2. It checks
permissions for the real user, whereas Exim wants to check for the
effective user. The only way I can see of doing this would be to write a
lot of code to check the owner and group of the file against the
effective uid/gid. This would be trying to repeat what the OS has to do,
and I really don't want to have to replicate (accurately) that kind of
checking.

Is there a function that answers the question "Does user xxx have access
yyy to file zzz?" ? Or even "Does the effective uid/gid have access yyy
to file zzz?" ? (For read/write you could (expensively) just try to
open the file and see if it works. It is the execute permission that is
more tricky.)

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



--
*** Exim information can be found at http://www.exim.org/ ***