From https://unix.stackexchange.com/a/18290/674
The kernel view
Conceptually, there are three sets of groups that a process is a member of. Each set is a subset of the following one.
- The single group that is the process's default group, which files created by this process will belong to.
- The set of groups that are checked when the group requires permission to open a file.
- The set of groups that a process running with extra privileges process can draw upon.
For historical reasons, these sets are respectively:
- the effective group ID (egid);
- the effective group ID plus the supplementary group IDs;
- all of the above plus the real group ID and the saved set-group-ID.
Questions:
What is the case of "a process running with extra privileges process can draw upon" in point 3?
Is this case different from the case of "when the group requires permission to open a file" in point 2?
Do the "supplementary group IDs" include the primary group ID, in general and in point 2 respectively?
By "in general", I mean that I notice the output of
id
includes both primary and supplementary groups followinggroups=
, while https://unix.stackexchange.com/a/18203/674 says "each user can belong to a number of supplementary groups - and these are listed at the end ofid
output." So I wonder if the primary group is also a supplementary group?
Thanks.