Question
There are three parts to this question. a) Suppose a process has (effective) user-id (UID) 1000 and (effective) group-id (GID) 2000. Further suppose that an
There are three parts to this question.
a)
Suppose a process has (effective) user-id (UID) 1000 and (effective) group-id (GID) 2000. Further suppose that an ordinary file example is owned by user 4101 and has a group-id of 2000. Assume that example contains a binary executable program. For each possible mode of file access (read, write, and execute) state whether a kernel call requesting that type of access would succeed when example has each of the following permissions.
rwxr-xrwx
r-xrwxr-x
rwx--x---
rwxrw-r--
------rwx
---rwx---
r---w---x
Use a table to present the answers to this question. The table should have column headings "permission setting", "read", "write", "execute". Entries in the cells under the last three columns must be either "Y" or "N". Place your table within a file named q3_solution.txt and clearly label it as the answer to part a.
b)
Repeat part (a), but this time for a process that has UID 4101 and GID 2001 (and ownership of file example is unchanged). Label the table with your answer as being the response for part b.
c)
In UNIX/LINUX "x" permission is interpreted differently for directories than for ordinary files. This part of question 3 explores that difference.
Suppose you have a folder (subdirectory) in your current working directory called test. Inside this subdirectory there is at least one file, sample.txt, containing one line of text, "this is file sample.txt". Permission on file sample.txt is u+r and you are the owner of the file. However, the file msg.txt does not exist in subdirectory test.
Consider the following commands:
ls test
ls test/*.txt
echo "new message" > test/msg.txt
cat test/sample.txt
Say whether each of the above four commands will succeed or fail (result in an error and the function not being performed) when the permissions on subdirectory test vary among the following alternatives:
rwxrwxrwx
r--r--r--
-w--w--w-
--x--x--x
r-xr-xr-x
rw-rw-rw-
-wx-wx-wx
Again, use a table to record your answer. The first column should have the heading "permission setting". There should then be a column for each of the commands labelled i, ii, iii, and iv above. Finally, the entries in the cells under the last four columns must be either "Y" or "N", indicating whether the command succeeded. Label the table with your answer as being the response for part c.
Before starting the set of commands for a given permission setting, make sure that test/msg.txt does not exist. Also be sure to not have any aliases for ls defined.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started