Re: Purpose of O_EXEC?
- From: Kostik Belousov <kostikbel@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 19:05:31 +0300
On Mon, Mar 31, 2008 at 06:01:48PM +0200, Ivan Voras wrote:
Hi,
What is the purpose of O_EXEC ("open file for execution") flag to
open(2)? Just a hint to the VM system on how to cache the file pages or
is there something else that makes it different from O_RDONLY?
No,
this is the only way to open file that has, for instance, mode 0111.
You can get the filedescriptor pointing to this file, that is useful
for the fexecve(2). Note that fexecve(2) ignores the open mode of the
filedescriptor and checks the vnode access right for the exec.
Attachment:
pgpJJTbaalfKN.pgp
Description: PGP signature
- References:
- Purpose of O_EXEC?
- From: Ivan Voras
- Purpose of O_EXEC?
- Prev by Date: Purpose of O_EXEC?
- Next by Date: Re: MODULES_OVERRIDE magic needed
- Previous by thread: Purpose of O_EXEC?
- Index(es):