I have GNU C Library (EGLIBC) stable release version 2.11.1
In an application i want to use seteuid function from #include <unistd.h> and check that it did what it was supposed to do...
Code:
[..]
/*
* Seteuid to testuser1
*/
printf("\t[%d] seteuid to %d ... ", getpid(), getuserid(username1));
if (seteuid(getuserid(username1)) == -1) {
rmuser(username1);
rmuser(username2);
die(ERRSEUID, vm, "error.\n", REQUIREMENT);
}
myprintf("done.\n");
myprintf(vm, "\t[%d] I am now ... ", getpid());
system("whoami");
[...]
Running this as root (sudo):
Code:
[...]
[528] seteuid to 65535 ... done.
[528] I am now ... root
[...]
getuserid is a function that returns correctly the uid of a user.
Need help. Thanks a lot.