I'm building a website which will run tcl scripts in the background.
I have few tcl scripts which I would like to call from my website and execute it. I'm designing the page using PHP in Linux/Apache server. I have few users who would be executing these scripts, but these scripts should be executed as that user and not the webuser (_www) as the tcl script will automatically send reports in the end to the user who executed it.
One option I thought was to change user (su) and then execute the script through shell_exec
, but I see some security issues with this.
So is there better approach to this?