On Fri, Feb 26, 2010 at 9:28 AM, Steve Simon <st...@quintile.net> wrote:
> Who enforces the exec bit on plan9?
>
> It appears to me (though my code may be buggy) that
> the file server is expected to enforce the exec bit
> in the file's modes when a file is opened with OEXEC.
>
> I would have expected rc(1) to have checked the mode and
> not to have tried to exec() the file if the exec bit in the
> file's mode is not set.
>
> Is it another case of "This is Plan9 not Unix" or perhaps
> I am mis-remembering that too?

I think enforce is the wrong mindset.  (This is Plan 9, not Unix.)
OEXEC and OREAD are just two different ways
to open a file for reading.  As a convenience to exec
more than anything else, most file servers associate
them with different permission bits, but absolutely
nothing stops you from reading an 0111 file or
executing an 0444 file; in both cases, open it with
the right mode, read out a copy, and change the
bits on your own copy.

Russ

Reply via email to