07-04-2008, 10:30 AM
So I am making a semi-public SRCDS test enviornment where users can test their server-side mods and scripts in a controlled environment through SSH console. This also implies that I need to control precisely the parameters given to the srcds_amd executable (for example setting the IP, port, tickrate and maxplayers) and not let the users directly call it with their own parameters.
For this my permission control denies the user accounts from accessing srcds_run or srcds_amd directly but they have access to my own program that then executes srcds_amd with elevated privilegies (setgid flag) and appropriate parameters.
The problem is that srcds_amd requires LD_LIBRARY_PATH environment variable to be set to .:bin for it to be able to load the .so files. Unfortunately for my case the Linux system - as a security measure - clears the LD_LIBRARY_PATH environment variable on any process running with setuid or setgid. This means that srcds_amd can never load its libraries (it fails on loading bin/dedicated_amd.so).
The box hosts both older Source games (Counter-Strike: Source, Half-Life 2: Deathmach) and Orange Box engine games (Team Fortress 2, Day of Defeat: Source), so the load paths also cannot be statically set for ld.so (and won't even work, ldconfig only caches files that begin with lib -prefix).
Now I would need some good ideas on how to make srcds_amd able to load its files in this setup.
Thanks in advance.
For this my permission control denies the user accounts from accessing srcds_run or srcds_amd directly but they have access to my own program that then executes srcds_amd with elevated privilegies (setgid flag) and appropriate parameters.
The problem is that srcds_amd requires LD_LIBRARY_PATH environment variable to be set to .:bin for it to be able to load the .so files. Unfortunately for my case the Linux system - as a security measure - clears the LD_LIBRARY_PATH environment variable on any process running with setuid or setgid. This means that srcds_amd can never load its libraries (it fails on loading bin/dedicated_amd.so).
The box hosts both older Source games (Counter-Strike: Source, Half-Life 2: Deathmach) and Orange Box engine games (Team Fortress 2, Day of Defeat: Source), so the load paths also cannot be statically set for ld.so (and won't even work, ldconfig only caches files that begin with lib -prefix).
Now I would need some good ideas on how to make srcds_amd able to load its files in this setup.
Thanks in advance.