Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site wanginst.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!wanginst!gill From: gill@wanginst.UUCP (Timothy Gill) Newsgroups: net.unix Subject: inconsistency on read/execute permissions for shell procedures Message-ID: <761@wanginst.UUCP> Date: Tue, 2-Jul-85 10:37:34 EDT Article-I.D.: wanginst.761 Posted: Tue Jul 2 10:37:34 1985 Date-Received: Thu, 4-Jul-85 04:13:28 EDT Distribution: net Organization: Wang Institute, Tyngsboro, Ma. 01879 Lines: 44 All of the UNIX documentation I read states that programs and other executable files (shell procedures) are equivalent. Yet I find that a file with the permissions -rwx--x--- will execute for members of my group if it is a program but will not execute if it is a shell procedure. For a shell procedure to run for those users, there must also be read permission on the file: -rwxr-x--- This is the case when my interactive shell is either "sh" or "csh". This is clearly inconsistent. Some people have tried to explain it to me by saying that a shell procedure must be "read" by the shell to be executed and that this is the reason the read permission must be there; if this is so, why cannot the same reasoning me made for program files? They have to be "read" just as much as shell procedures. The problem is that I wish some shell procedures to be executable by other users without being readable by them, and the structure and consistency of the UNIX file permission system leads me to believe that this is possible. However, I cannot make it happen. Can someone inform me how to make a shell procedure executable without it also being readable by others? Nothing I have read states that the read permission must be set. For example, Section 2.0 of Bourne's "An Introduction to the UNIX Shell" states: UNIX files have three INDEPENDENT [my emphasis] attributes, "read", "write" and "execute". The UNIX command "chmod" (1) may be used to make a file executable. For example, "chmod +x wg" will ensure that the file wg has execute status. Following this, the command "wg fred" is equivalent to "sh wg fred". This allows shell procedures and programs to be used interchangeably. So, can someone explain this UNIX inconsistency? Responses mailed to me will be summarized for this group. [We run Ultrix 1.0 (BSD 4.2)].