Next: File System Permissions
Up: Secure Programming
Previous: Users and Groups
- The system knows only which user ID is in use, not which user is typing the commands.
- Every process has an associated user ID and group ID. When you invoke a command, it typically runs in a process whose user and group IDs are the same as your user and group IDs.
- When we say that a user performs an operation, we really mean that a process with the corresponding user ID performs that operation.
- When the process makes a system call, the kernel decides whether to allow the operation to proceed. It makes that determination by examining the permissions associated with the
resources that the process is trying to access and by checking the user ID and group ID associated with the process trying to perform the action.
- The http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/simpleid.c program in Fig. 8 shows a simple program that provides a subset of the functionality provide by the id command:
Figure 8:
Print User and Group IDs.
|
$ ./simpleid
Next: File System Permissions
Up: Secure Programming
Previous: Users and Groups
Cem Ozdogan
2007-05-07