SUID and SGID not working on Red Hat Enterprise Linux ES release 4
We are moving from SCO to Red Hat Enterprise Linux ES release 4.
We have other older version of Red Hat running as well.
But somehting I have found on this version is a problem with SUID and SGID programs.
We have an application that needs to run as a different user. All the files are owned and RW but that user. Therefore not other use can gain access to the files.
Simple solution we have used for years is to have the executable SUID to that user.
-rwsr-sr-x 1 bbx group 863052 Sep 24 2001 bbx4
The application then runs as bbx and everyone is happy.
However on this version it is almost as if the SUID bit is not set. The application runs as the calling user and therefore can not gain access to the files.
I have created a simple C program.
-rwsr-xr-x 1 root root 5319 Nov 11 10:28 tuid
When I run it I print the results of getuid() and geteuid(). This is what I get:
uid: 203 euid: 203
So it is obviously not working. Same happens if the owner was bbx as in the first example.
This is fairly wired into how the entire application works. The effective user id is the new user and the uid remains the same. That way we can easily switch back to the original user when needed.
So what is it under this version of linux that is preventing SUID programs from having their effective user id changed and is there a way around this?