Question

In: Computer Science

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?

Solutions

Expert Solution

Compromising the access control problems:

• The file has only read permission for the group and others. The file has no write and execute permissions for the group and others whereas the directory has the write and execute permissions for the users of the group. So, the member of the group may change the content of the file or file may be deleted. Thus, the permissions given to the file are of no use.

• The file has the read permission for the others whereas the directory has no permission for others. Thus, the content of the file cannot be read by the others. The permissions given to the file are of no use.

File permissions:

The file and directory permissions contain ten digits (xxxxxxxxxx).

• The first digit represents that one is a file or directory.

• The next nine digits (2-10) represent the allowed access permissions to the user and it is categorized as three groups.

o Each group contains three digits (2-4), (5-7), (8-10).

• The three digits may contain dash (-), r (read), w (write), x (execute) characters.

o The digits (2-4) shows the user access privileges granted to the owner of the file.

o The digits (5-7) shows the access privileges granted to the group user.

o The digits (8-10) shows the access privileges granted to anyone.

File is having the octal code 644 then the file permission code is -rw-r--r--

• The number 6 represents rw- that provides a read and write access privilege to the owner of the file.

• The number 4 represents r-- that provides a read access privilege to the users of a group.

• The number 4 represents r-- that provides a read access privilege to others.

Directory is having the octal code 730 then the file permission is -rwx-wx---

• The number 7 represents rwx that provides a read, write and execute access privilege to the owner of the directory.

• The number 3 represents -wx that provides write and execute access privilege to the users of a group.

• The number 0 represents --- that provides a “Null” access privilege to others.


Related Solutions

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?
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