unix nube question
Bruce Barnett <spamhater113+U050305054519@grymoire.com> writes:
No, it depends on the user's permissions on the file.
No, it depends on the group's permissions on the file.
Your description above is quite inaccurate. What matters is "the user
ID of the person" but the effective user ID of the process, and also
not "the list of groups of the user" as found in /etc/passwd and
/etc/groups but the effective group ID and the supplementary groups of
the process.
A more accurate description is:
Each file (regular file, directory, char or block special device file,
etc.) has in its inode a user ID, a group ID, and 9 bits of
permissions, i.e. 3 bits corresponding to the user ID, 3 bits
corresponding to the group ID and 3 bits for "others".
Each process has (besides further attributes) an effective user ID, an
effective group ID, and a list of supplementary group IDs (typically
limited to 16 or 32 IDs).
1. If the effective user ID of the process if 0, access is granted.
2. Otherwise, if the user ID of the file matches the effective user ID
of the process, the 3 permission bits corresponding to the user ID
are checked.
3. Otherwise, if the group ID of the file matches the effective group
ID of the process or one of the list of supplementary group ID, the
3 permission bits corresponding to the group ID are checked.
4. Otherwise, the 3 permission bits for "other" are checked.
Many modern Unices and Unix file systems have more complex rules for
checking access to files. Instead of allowing everything toe root,
i.e. processes with effective uid 0, some systems know POSIX
capabilities, so processes can have the several capabilities of file
access operations, the capability to set the uid and gid, the
capability to send signals, etc. Modern file systems support access
control lists (ACL) that allow you specify different file access
permissions for a number of users and/or groups.
Followup set to comp.unix.questions, since this is OT in all of the
other groups.
urs
|