Question: Write two library functions in C programming language for system calls (A setter method for setting the security tag value in Linux) and (A getter

Write two library functions in C programming language for system calls (A setter method for setting the security tag value in Linux) and (A getter method for getting the security tag value in Linux)

int set_security_tag(const char *filename, int new_tag) { // Invokes the system call which attempts to change the file's Security_Tag to new_tag

// Returns the changed Security_Tag on success, otherwise it returns "-1" }

int get_security_tag(const char *filename) { // Invokes a system call which reads the security tag of the input file

// It will return Security_Tag upon success; otherwise it will return a value of "-1"

}

Rules are as follows:

Each file in the process of being changed will have a Security_Tag

The rules for the Security_Tag are

1) Every file will contain a default value of zero for the Security_Tag

2) Processes which are classified as running as superuser will be able to read or write the Security_Tag of every file

3) The read and write access permission for files of a user is based on standard Linux file permissions

4) The Security_Tag will exist during and after rebooting the system

5) System call formats are: syscall(call_number, parameter1, parameter2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!