Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!munnari!mwp From: mwp@munnari.oz (Michael W. Paddon) Newsgroups: comp.unix.wizards Subject: Re: Strange reaction to wierd file mode Message-ID: <1785@munnari.oz> Date: Wed, 19-Aug-87 07:27:07 EDT Article-I.D.: munnari.1785 Posted: Wed Aug 19 07:27:07 1987 Date-Received: Sat, 22-Aug-87 01:09:53 EDT References: <719@csun.UUCP> Organization: Comp Sci, Melbourne Uni, Australia Lines: 31 in article <719@csun.UUCP>, aeusesef@csun.UUCP (Sean Eric Fagan) says: > > 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. I understand what it's doing, > but what I want to know is if the rest of the world considers this a bug, a > feature, or something which doesn't matter. > > (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.) This is *not* a bug. You created a file with write permission denied to the owner (that's you). Suprise! The kernel would have (rightly so) given "permission denied" or some such error. The 07 mode bits on a file refer to everyone but the owner and those users in the file's group not, as some people assume, *everbody*. Have a look at the stat(2) manual entry. This has nothing to do with where the code is situated, kernel or not. Note that the calls you mention are already in the kernel anyway and that all possible file modes are legal (in the 07777 range anyway). Michael Paddon ============== =========================== UUCP: {seismo,mcvax,ukc,ubc-vision}!munnari!mwp ARPA: mwp%munnari.oz@seismo.css.gov CSNET: mwp%munnari.oz@australia