Question: Write a C program fragment that: Loads the environment variable $USER which set on login to any account. If the value of $USER is root,
Write a C program fragment that:
- Loads the environment variable $USER which set on login to any account.
- If the value of $USER is "root", create a file exploit in the directory /usr/bin
- Change the user permissions of the file so that others can execute the program.
- If the user is not root, test whether there already is a file /usr/bin/exploit that the current user can execute.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
