Switching user ID inside a web-application
I'm working on a new Java EE application which will be used as common front-end for command-line applications. The application should be able to read/modify files and to execute applications inside the end-users home directory (yes, the UNIX profiles and the application-server are on the same server). These requirements on the software force us to find a way how to switching the user-id inside the running application server (without root). Writing a JNA/JNI interface to setuid could do this, but then we have to run Glassfish as root which is not that what we want.
So is there any solution out there for this problem?