Finish Chapter 15
- chown
- The command
- chown newuser file
- chown newuser:newgroup file
- Must have permission to do so
- The system call
int chown(const char *pathname, uid_t owner, gid_t group);
- lchown, fchown
- uid and gid, talk about /etc/passwd, /etc/group.
- The process must be privileged to do this.
- Chmod and file permissions
- The command
- chmod [ugo] [+-] [rwxs] file
- Or give the octal values see page 295
- setuid bit
- Allows a process to execute as a different user.
- setgid bit
- Allows a process to execute as a different group.
- Also forces files created in a directory to be owned by a given group.
- The sticky bit
- Keep a file memory resident (old)
- Deny group and other file removal permission on a directory. (new)
- Setuid and setgid scripts are bad.
- setuid and setgid programs are sources of problems.
- What do permissions mean on directories mean?
- The book notes that the strictest permissions are applied when checking paths.
- IE User is tested against user, not group and other.