[comp.os.minix] path to allow X bit to be sufficent to exec

Leisner.Henr@xerox.com (Marty) (03/15/88)

I inserted the following patch into fs/open.c/do_open() to allow the memory
manager to read files with only the X bit set.

#ifdef ORIGINAL
  if ((r = forbidden(rip, bits, 0)) != OK) {
	put_inode(rip);          /* can't open: protection violation */
	return(r);
  }
#else
	/* patch to allow X bit to be sufficient to execute file -- MM does it's
	 * own protection checks 
	 */
	if(who != MM_PROC_NR && ((r = forbidden(rip, bits, 0)) != OK)) {
		/* allow MM to open up anything he wants */
		put_inode(rip);          /* can't open: protection violation */
		return(r);
	  }
#endif

Since the memory manager goes through mm/utility/allowed to check file
permissions, I'm suspending access checks in fs on mm open calls.  Kinda
kludgey, but seems to do what I want without any bad side effects.  Anyone have
any better ideas?

I suppose a cleaner way may be to define a special open bit which becomes
something like EXEC_ONLY.

It looks to be reasonable to perhaps push off the access level checking in
mm/utility/access to the file system.

marty
ARPA:	leisner.henr@xerox.com
GV:  leisner.henr
NS:  martin leisner:henr801c:xerox
UUCP:	nsc!nscimg!amps!marty