Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!uunet.UU.NET!sef From: andrew@alice.att.com (Andrew Hume) Newsgroups: comp.std.unix Subject: access permissions in 1003.1 Message-ID: <1991Jun2.082051.7235@uunet.uu.net> Date: 2 Jun 91 04:22:55 GMT Sender: usenet@uunet.uu.net (UseNet News) Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 35 Approved: sef@uunet.uu.net (Moderator, Sean Eric Fagan - comp.std.unix) Originator: sef@uunet.UU.NET Nntp-Posting-Host: uunet.uu.net X-Submissions: std-unix@uunet.uu.net Submitted-by: andrew@alice.att.com (Andrew Hume) While casually reading ISO 9660, I happened across the file permissions field for a file. This is some twisted person's idea of a joke but probably is the VMS permissions field. What was not specified was what happens if two different bits conflict (more on what i mean exactly below). ``Ha!!'', I said, ``1003.1 would have gotten that right!'' Unfortunately, I couldn't find the explanation in 1003.1. Can someone help me out here? The problem, phrased in 1003.1's terms, is what happens if i am both the owner and group of a file with mode 040; can I read it? There are actually two problems. One is that 1003.1 defines bits and mentions words like read permission and masks but never actually says what the meaning of S_IRUSR (for example) is when it is set (or not). But let us pass over that and assume the wording should have been something like: If S_IRUSR is set, then the user whose ID == st_uid may read the file. If S_IRUSR is not set, then the user whose ID == st_uid may not read the file. The second problem then arises; in this scenario, one clause says I may read and the other says I may not read. How do I break this conflict? Of course, in Unix (which after all is only distantly related to 1003.1), the access bits are interpreted or enforced as 1) if i am the owner, then the owner permissions apply. 2) otherwise, if i match the group, then the group permissions apply. 3) Otherwise, the other permissions apply. But I couldn't find words to that effect in 1003.1. Where should I be looking? andrew hume andrew@research.att.com Volume-Number: Volume 23, Number 81