subject

Assume the following struct is declared for the permission list of a file in Linux. Each permission (u or g or o) is represented as an octal. For example, u=7 means rwx, u=5 means r-x.

typedef struct {
unsigned int uid; // owner id
unsigned int gid; // group id
unsigned char u; // owner's permission
unsigned char g; // group's permission
unsigned char o; // other's permission
} Permission;

The permission check procedure is

(1) A user requests an operation on a file.
(2) If the user is the owner of the file, the operation will be checked against the owner's permission of the file. The result is either grant or deny.
(3) Otherwise, if the user is not the owner but in the group of the file, the operation will be checked against the group's permission of the file. The result is either grant or deny.
(4) Otherwise, if the user is neither the owner nor in the group of the file, the operation will be checked against the other's permission of the file. The result is either grant or deny.

Write a C/C++ function accesscheck(unsigned int uid, unsigned int gid, unsigned char req, int fid) to enforce access control in Linux.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Which software would you use to create a print design? a. illustrator b. audacity c. reaper d. dreamweaver
Answers: 2
question
Computers and Technology, 24.06.2019 01:00
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the file tab. click the file tab, then click print, or click the page layout tab. click the page layout tab, or click the review tab. click the review tab, or click the home tab?
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
You know the right answer?
Assume the following struct is declared for the permission list of a file in Linux. Each permissio...
Questions
question
English, 14.06.2021 17:00
Questions on the website: 13722367