Is there a way to give a process on Linux based systems unique permissions in C? I basically want to restrict a process (launched by a host, like an event handler) from editing any files outside it's working directory, and creating sockets and such.
Would the only way to do it is to have a host process create a new user for each process it spawns and destroy the user afterwards?