I was assigned to
Write a C program that prints the following identifiers PID, PPID, SID, PGID, UID, EUID.
The assignment then went on to ask
What represents each identifier?
I have completed the program, but have not found adequate explanations for the identifiers.
- What do they really represent?
- Especially what is the purpose of the SID and PGID identifiers?
They're as follows
Take a look at this SO Post and the first answer for a healthy explanation of what they're for.
From the recommended page of definitions they posted
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html
3.270 Parent Process ID
3.343 Session
3.296 Process Group
3.297 Process Group ID
3.142 Effective User ID†
† Note that the EUID and EGID (Effect Group ID) are not used for filesystem permissions under Linux which takes filesystem's FSUID and FSGID fields respectively instead.
Summary of Linux Security Features from the RedHat 6.x docs has a good and concise explanation of how these behave under Linux:
http://www.mit.edu/afs.new/athena/system/rhlinux/redhat-6.2-docs/HOWTOS/other-formats/html/Secure-Programs-HOWTO-html/Secure-Programs-HOWTO-3.html