http://codeschool.org/ This work is licensed under a Creative Commons Attribution- ShareAlike 3.0 Unported License. Unix system calls (part 1) • history and usage of Python • basic data types and the type hierarchy • syntax • modules and variable scopes
55
Embed
Http://codeschool.org/ This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Unix system calls (part 1) history and.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
http://codeschool.org/This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Unix system calls (part 1)
• history and usage of Python• basic data types and the type hierarchy• syntax• modules and variable scopes
http://codeschool.org/This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Unix system calls(part 1)
http://codeschool.org/This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
This is one part of a larger series. You may need to view previous parts to understand this material.
It’s a Unix system!
System V BSD
1980’s
Linux Mac OS X
FreeBSD, OpenBSD
today
POSIX (Portable Operating System Interface for Unix)
exec (sets effective and saved ids when binary file has setuid bit)
exec (sets effective and saved ids when binary file has setuid bit)
seteuid (sets effective user id)
setuid (sets real, effective, and saved user ids)
exec (sets effective and saved ids when binary file has setuid bit)
seteuid (sets effective user id)
setuid (sets real, effective, and saved user ids)
non-superuser can only directly set effective id to match the real or saved id
pid 1 (init), user 0
pid 3 (shell), user 1780
pid 2 (login), user 0
pid 1 (init), user 0
pid 3 (shell), user 1780
pid 2 (login), user 0
fork, exec
pid 1 (init), user 0
pid 3 (shell), user 1780
pid 2 (login), user 0
fork, exec
fork, setuid, exec
user groups:
/etc/group
• user may belong to multiple groups but has one “primary” group• each file and directory is owned by one group• each process has a real, effective, and saved group id• binary files have setgid bit• setegid and setgid
rwx rwx rwxuser group other
rwx rwx rwxuser group other
if file_user_id == effective_user_id:user class
else if file_group_id == effective_group_id:group class
else:other
file permissions:read: can read bytes of filewrite: can modify bytes of fileexecute: can exec file
directory permissions:read: can get names of fileswrite: can add/remove/rename filesexecute: can use in file paths
directory permissions:read: can get names of fileswrite: can add/remove/rename filesexecute: can use in file paths
/adams/taft/garfield/eisenhower
directory permissions:read: can get names of fileswrite: can add/remove/rename filesexecute: can use in file paths
/adams/taft/garfield/eisenhower/adams/taft/ (OK)
r-xr-xr-xrw-r-----r-x--x--xrwx------
/adams/lincoln/adams/cleveland/roosevelt/fillmore
rwx rwx rwxuser group other
dr-xrw-r-x /adams/
rwx rwx rwxuser group other
http://codeschool.org/
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.