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:

  1. Loads the environment variable $USER which set on login to any account.
  2. If the value of $USER is "root", create a file exploit in the directory /usr/bin
  3. Change the user permissions of the file so that others can execute the program.
  4. 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 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!