Question

In: Computer Science

Unix treats file directories in the same fashion as files; that is, both is defined by...

Unix treats file directories in the same fashion as files; that is, both is defined by the same type of data structure, call an inode. As with files, directories include a non-bit protection string. If care is not taken, this can create access control problems. For example, consider a file with protection mode 644 (rw- r-- r--) contained in a directory with protection mode 730 (rwx -wx ---). How might the files be compromised in this case?

Solutions

Expert Solution

For example, consider a file with protection mode 644 (rw- r-- r--) contained in a directory with protection mode 730 (rwx -wx ---). How might the files be compromised in this case?

Read(r)

  • Grants the capability to read, i.e., view the contents of the file.

Write(w)

  • Grants the capability to modify, or remove the content of the file.

Execute(x)

  • User with execute permissions can run a file as a program.

When a file with protection mode 644 (rw-r--r-- which is read, write for user; read for group; read for others) is contained in a directory which has file permissions mode 730 ( rwx - wx --- whrere rwx is read , write, execute for user/owner; wx is write and execute for group and nil for others)

For USER/OWNER

File permission- 644 (rw- r-- r--) Directory permission- 730 (rwx -wx ---)

This means that the file inside permissions mode 730 will have no issues in accessing for the user/owner since the file rwx permission and the user will be able to read, write and execute the files within that directory.

For GROUPS

File permission- 644 (rw- r-- r--) Directory permission- 730 (rwx -wx ---)

Whereas for the group user, the directory has wx (write,execute) permissions only , so the groups cannot read the file although they have read permission fot he actualy file but not for the folder in which it resides. They can only write or execute the file but it will be of no use since they cannot read it.

For OTHERS

File permission- 644 (rw- r-- r--) Directory permission- 730 (rwx -wx ---)

The directory has given no permissions at all for others, so even though they have read permissions to the file, they cannot read it as the directory in which it resides has given no permissions to them. They cannot acces the file at first, so the read permission is of no use to them.


Related Solutions

UNIX treats file directories in the same fashion as files; that is, both are defined by...
UNIX treats file directories in the same fashion as files; that is, both are defined by the same type of data structure, called an inode. As with files, directories include a nine-bit protection string. If care is not taken, this can create access control problems. For example, consider a file with protection mode 644 (octal) contained in a directory with protection mode 730. How might the file be compromised in this case?
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of...
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of mv command The mv command is more than just a wrapper around the rename system call. Write a version of mv that accepts two argument. The first argument must be the name of a file, and the second argument may be the name of a file or the name of a directory. If the destination is the name of a directory, then mv moves...
What are the UNIX codes for each of these steps Display the directories and sub-directories including...
What are the UNIX codes for each of these steps Display the directories and sub-directories including files so I can verify your starting point. Redirect the above step to the lab3.txt file Make a sub-directory named Files in your user directory
Basic Unix Commands Objective: The objective of this lab is to work with files of UNIX...
Basic Unix Commands Objective: The objective of this lab is to work with files of UNIX file system. Procedure: 1. OpenyourUnixshellandtrythesecommands: Ø Create a new file and add some text in it vcat > filename Ø View a file vcat /etc/passwd vmore /etc/passwd vmore filename Ø Copy file, making file2 vcp file1 file2 Ø Move/rename file1 as file2 vmv file1 file2 Ø Delete file1 as file2 vrm file //Deletefile //Double-checkfirst vrm -i file Ø Counts the lines, words, characters in...
Display and store a long listing of all the regular files and directories in /personal_files. Store...
Display and store a long listing of all the regular files and directories in /personal_files. Store the output in a file called mypersonalfiles. UNIX
List all files and directories in the current directory and store in a variable called malf....
List all files and directories in the current directory and store in a variable called malf. Count how many lines end with your firstname in the file /etc/conf Explain this command: mv pmu*.[ab]   cces/   Quick help in 5 min pleases with the UNIX program! I want only the final answer
Linux Directories, File Properties, and the File System in C Code your version of mv command...
Linux Directories, File Properties, and the File System in C Code your version of mv command in C The mv command is more than just a wrapper around the rename system call. Write a version of mv that accepts two argument. The first argument must be the name of a file, and the second argument may be the name of a file or the name of a directory. If the destination is the name of a directory, then mv moves...
Linux Directories, File Properties, and the File System in C Your version of find command Try...
Linux Directories, File Properties, and the File System in C Your version of find command Try running the find command in the shell and observe the output. Try it in different folders to make sure you understand what it prints out. $ find Write your version of the find command and add comments.
What are the UNIX commands for each of these steps? 1. Copy all of the files...
What are the UNIX commands for each of these steps? 1. Copy all of the files in your Files directory to the Backup directory. 2. Create an ITE130 directory in the Classes Directory 3. Move all the ITE 130 files from the backup directory to the ITE130 directory. 4. Redirect echo step 19 to mark this step in the lab3.txt file 5. Display all of the directories and sub-directories including files so I can verify you completed all the above...
What are the UNIX commands for each of these steps? 1. Delete all the files in...
What are the UNIX commands for each of these steps? 1. Delete all the files in the Classes and Backup directories only. 2. Redirect echo step 23 to mark this step in the lab3.txt file 3. Display all of the directories and sub-directories including files so I can verify you completed all the steps correctly. 4. Repeat the above step and redirect the output to the file lab3.txt without erasing what is already in it! 5. Redirect echo step 26...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT