Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!uwvax!oddjob!gargoyle!ihnp4!inuxc!iuvax!pur-ee!ea.ecn.purdue.edu!davy From: davy@ea.ecn.purdue.edu (Dave Curry) Newsgroups: comp.unix.wizards Subject: Re: Strange reaction to wierd file mode Message-ID: <366@ea.ecn.purdue.edu> Date: Thu, 20-Aug-87 09:41:17 EDT Article-I.D.: ea.366 Posted: Thu Aug 20 09:41:17 1987 Date-Received: Sat, 22-Aug-87 11:35:27 EDT References: <719@csun.UUCP> Reply-To: davy@ea.ecn.purdue.edu.UUCP (Dave Curry) Organization: Purdue University Engineering Computer Network Lines: 45 In article <719@csun.UUCP> aeusesef@csun.UUCP (Sean Eric Fagan) writes: >While playing with an AT&T SystemV 2.0 Unix, I made a little file >with access mode 0446 (r--r--rw-), and tried to write into it. >Surprise! The kernal said I couldn't. No surprise. The three sets of permissions on a file are: - permissions for the owner of the file, - permissions for other members of the file's group, EXCLUDING the owner, and - permissions for other users of the system EXCLUDING the owner and members of the file's group. These permissions are applied by the kernel in a left to right order until they match. I.e., if you own the file, the first set of permissions apply. If you do not own the file, but are a member of the group, the second set applies. If you are not the owner and not in the group, only then does the third set apply. Since you own the file, the set of permissions applied to you are the owner permissions, which do not include permission to write. >(A friend suggested putting code in the kernal for creat, chmod, etc. so >that this type of mode wouldn't happen; I disagree about this type of >kludge.) Please ask your friend to stay away from the kernel until he knows what he's doing. There are perfectly valid uses for permisssions like this, such as preventing a given group of people from doing things to a file, and so on. >(*I* think it's a bug, but then I'm only a lowly student who isn't allowed >to look at source code 8-)) It most certainly is NOT a bug. If the kernel had allowed you to write the file when world-write was on and owner-write was off, then what would be the point of having owner permissions at all? As a more useful example, consider the group permissions - if the world permissions allowed write to everyone as under your scheme, there would be no way to PREVENT a given group of people from writing the file (since group permissions would be meaningless). Under the current scheme, you can do this. --Dave Curry Purdue University