Question: The following code is the C source of the root owned SetUID - program securePasswd which has the file permission 4 7 5 5 .

The following code is the C source of the root owned SetUID-program "securePasswd" which has the file permission 4755.
When the regular user "seed" (UID=1000) executes the program "securePasswd", what will be the UID and EUID of this process when "execve" system call being made?
Whether the program "securePasswd" is secure or not. Answer why or why not.
#include #include
void main()
{
int fd; char *v[2];
/*/etc/passwd is an important system file,
* and it is owned by root with permission 06
*/
fd = open("/etc/passwd", O_RDWR | O_APPEND);
if (fd ==-1){
printf("Cannot open /etc/passwd
") ;
exit(0);
setuid(getuid());
hne-HanAus.-ed d Instneture ER2/nroviou?neintOnl ad-
Dane A At ?
Quizzas - Proviowl
41126124.10:01414
v[0]="/bin/sh"; v[1]=0;
execve(v[0], v,0);

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