access permissions in 1003.1
Andrew Hume
andrew at alice.att.com
Sun Jun 2 14:22:55 AEST 1991
Submitted-by: andrew at 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 at research.att.com
Volume-Number: Volume 23, Number 81
More information about the Comp.std.unix
mailing list