> 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.

yes.

> 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.

rc does check, but the check is not bulletproof:

from plan9.c:/^Executable

        ret = ((statbuf->mode&0111)!=0 && (statbuf->mode&DMDIR)==0);

rc will try to execute a file for which the owner
has execute permission, but you are not the owner.
byron's rc goes to great pains to get this right, but
in plan 9 it's not really possible since there is no
way to get a user's groups.  since this is a property
of the fileserver, and by design you're not supposed
to know those things.  :-)

- erik

Reply via email to