Running programs under root with suid bit
i've got a minimal test case with a C program with the following code
After compiling the program and running it i get my own user id (1000), so thats fine.
printf("uid = %d", getuid());
printf("euid = %d", geteuid());
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.
I'm running debian lenny, executing the exact same commands on the ping executable does give me the correct results...