From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 26 Feb 2010 12:43:33 -0500 To: 9fans@9fans.net Message-ID: <329a0a1c22aba5018223cdfb2fe21f03@coraid.com> In-Reply-To: <7b956f03980157ec2a6357aaa14eb60f@quintile.net> References: <7b956f03980157ec2a6357aaa14eb60f@quintile.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] exec permission on plan9 Topicbox-Message-UUID: dc98e364-ead5-11e9-9d60-3106f5b1d025 > 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