Software Security Unix has a mechanism called a hard link by which it creates ad
ID: 3665629 • Letter: S
Question
Software Security
Unix has a mechanism called a hard link by which it creates additional directory entries that all point to the same file. This is easy to manage because most information resides in the file’s inode, including a count of the number of links. Bob is trying to create a hard link to a file in a FAT directory by duplicating the file’s existing directory entry and giving it a new name. How well do the file read, write, and delete operations work?
a. Which operations work correctly if a FAT file has two directory entries?
b. What operations won’t work correctly? How do those operations fail to work correctly?
Explanation / Answer
When a hard link is created on file, it shares same Inode for both the file (i.e. Main file and file created with Hard link). Inode contains the information about the permission as well.So same operations can be performed on the file that is created by Bob using hard link by giving a new name of the file.
a. As same Inode is shared among all the file as original and hard link based file, read write and delete operations can be perfomed on the both file. When we update (write) the content in original file then it is applicable to another named file with hard link and vise versa. Read operation will also work.
b. When we perform a delete operation it will not delete the actual file (either we delete original or linked file) it will not delete file becuase it just reduced the number of hard link of the file from Inode. if every link of the file has been deleted it contains the 0 in Inode entry for the number of Hard link for file.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.