Re: Run 4GL Program without Database Permissions?
Posted in 1996
Richard Spitz wrote: > > Jonathan Leffler (johnl@informix.com) wrote: > : Programs run by root do not use LD_LIBRARY_PATH to search for shared libraries. > : They only search in /usr/lib. This is for security reasons; otherwise, an unsuspecting > : superuser could be fooled into using a custom C library which did all sorts of funny > : things with the super-user privileges. > > True, but the programs are not SUID root, just the SUID bit is set for the > owner of the pain therapy database: > > -rwsr-sr-x 1 schmerz schmerz 97489 Sep 03 15:25 postop.4ge Yes, the restriction is not just setuid root, but all setuid programs (unless run by root of course). > : You need to create symbolic links in /usr/lib pointing to the I4GL shared libraries: > > I did. However, that didn't solve the problem. The program starts to run, > but stops immediately with "No CONNECT permission". > > Does that mean that Informix ignores the "effective user id" which is > set by the SUID bit? Yes, we use the real user ID. > This would mean that it is impossible to run a 4GL > program without having database permissions. No. It is still posible to set the real user ID, but only if you have super user privileges. This means that you have to make your program setuid root, then call setuid(userid) but before you do any database work. Due to the security implications of setuid root binaries you will obviously have to code in your own checks to ensure that only the correct users can execute this program. Cosmo