passwd: /etc/shadow
chsh: /etc/passwd
setuid (root). Setuid can make the executable file run under the privilege (EUID) of its owner.
So, setuid root will give passwd/chsh the root privilege, even if run by a regular user hence
able to access those root-owned files.
Signal handlers are invoked asynchronously, i.e., it can be any time during the program’s execution.
This effectively creates multiple points of execution (similar to multithreading). A variable being
operated on by the main thread can also be updated by the signal handler, if without proper
coordination. This can potentially lead to data corruption or inconsistency
Dynamic linking: Reuse of common code (1), saving space (2), dependency issues (3)
Static linking: Duplicate code (1), bloated size (2) , self-contained (3)
the length of the pathname it points to
A directory is at least pointed to by its orginal directory entry (e.g., ABC) in its
parent directory, and the current directory entry (“.”) inside it.
X=”Important Data” defines a shell variable and export makes it an environment variable.
Export allows subsequent commands or child processes to inherit the variable, by exporting
it to the environment.
c: character device. A type of device, not addressable, that can be accessed only sequentially,
character by character
4: major number. Determines which driver will handle the device. -> type
0: minor number, which refers to an instance of that type
Command line arguments.
Standard input.
Files.
Network.
etc.
If a process has completed execution (e.g., exit()), but has not been waited on by
the parent process (e.g., via wait()) and thus not cleaned up, its state is called zombie.
It still exists and takes space in memory.
Kill the parent process so that “init” takes over and call wait() to reap the process.
17
inode 17 corresponds to the parent directory (“mydir”) of file1 – file5.
The file name is only found in the directory entries (filename -> inode mapping),
not the inode of individual files. So if inode 17 is lost/corrupted, file1 – file5 will lose their names.
Superblock
Redirection takes a file as the destination while the pipline connects the output of
one program to the input of another. So the main difference will be that we need
*another program* to be used with the pipeline.
Commands for reference:
./ProgramA > FileA
or
./ProgramA | tee FileA
No
File descriptors are per process