Determining the access category

The second question posed previously: what access category will it run under? is important to answer.

The access category will be either Owner (U), Group (G), or Other (O); they are mutually exclusive. The algorithm used by the OS to determine the access category is something like this:

if process_UID == file_UIDthen     access_category = Uelse if process_GID == file_GIDthen     access_category = Gelse     access_category = Ofi

Actually, it's a bit more complex: a process can belong to several groups simultaneously. So, at permission checking time, the kernel checks all groups; if the process belongs to any one of them, the access category is set to G.

Finally, for that access category, check the permission bitmask (rwx); ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.