Well, that, of course, sounds like a dangerous idea, and I'd rather sit down and think about the whole strategy of what I'm trying to achieve.
The danger is the escalation of privileges of the script executable, which the remote user can modify or download, of course. The full chown / chmod in the web application is equivalent to just pasting your root password on the page.
What exactly is going to happen?
If chown should happen for some reason, but not for root (hopefully), then the functionality should be wrapped. I would take user requests and queue them, and then have a separate process (maybe shell, php, perl, anything) running as root cron, check this queue, check if the request matches the allowed parameters, and make changes,
source share