Running programs under root with suid bit
Hello,
i've got a minimal test case with a C program with the following code
Code:
#include <stdio.h>
int main(){
printf("uid = %d", getuid());
printf("euid = %d", geteuid());
}
After compiling the program and running it i get my own user id (1000), so thats fine.
Then i want to run it under root.
I do chown root.root <program name> and chmod 4771 <program name>
after running it again it still shows me 1000 as it's uid.
Trying stuff like loading modules also does not work, so it really does not have root.
Am i missing something here?
Any help would be greatly appreciated.
Ps.
I'm running debian lenny, executing the exact same commands on the ping executable does give me the correct results...