Question: Write a set-user-ID-root program similar to the sudo(8) program. This program should take command-line options and arguments as follows: The douser program executes program-file, with


Write a set-user-ID-root program similar to the sudo(8) program. This program should take command-line options and arguments as follows:


$ ./douser [-u user 1 program-file argi arg2. ...

The douser program executes program-file, with the given arguments, as though it was run by user. (If the –u option is omitted, then user should default to root.) Before executing program-file, douser should request the password for user, authenticate it against the standard password file (see Listing 8-2, on page 164), and then set all of the process user and group IDs to the correct values for that user.

$ ./douser [-u user 1 program-file argi arg2. ...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Creating a setuserIDroot program similar to the sudo program involves several steps such as authenticating user credentials setting user and group IDs ... View full answer

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 Programming Questions!