From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <7b956f03980157ec2a6357aaa14eb60f@quintile.net> References: <7b956f03980157ec2a6357aaa14eb60f@quintile.net> Date: Fri, 26 Feb 2010 10:28:05 -0800 Message-ID: Subject: Re: [9fans] exec permission on plan9 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Topicbox-Message-UUID: dc9ed17a-ead5-11e9-9d60-3106f5b1d025 On Fri, Feb 26, 2010 at 9:28 AM, Steve Simon 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