chmod +s not working as expected 2003-11-27 - By Cameron Simpson
Back On 14:45 27 Nov 2003, James Ho <james.ho@(protected)> wrote: | I just transported a program from Red Hat Linux 6.2 to Red Hat Linux 7.3. | The C program has a line stating: | system ("whoami"); | | The permission of the executable is 6777 (ie. -rwsrwsrwx) and the | owner of the program is "user1". | | Using another user login "user99", I execute the program in both Red Hat | Linux 6.2 and 7.3. | In 6.2, I get the output "user1" | In 7.3, I get the output "user99" | | Why is this? Is there any way I can get the program work as it did | in Red Hat Linux 6.2?
I can imagine the kernel not allowing setuid to work on a publicly writable file. The 7.3 box will have a newer (==> maybe more paranoid) kernel. Try making the permissions 6555 or 6111 and see how it behaves.
Cheers, -- Cameron Simpson <cs@(protected)> DoD#743 http://www.cskk.ezoshosting.com/cs/
If you 'aint falling off, you ar'nt going hard enough. - Fred Gassit
|
|