setgid() in run_email2trac doesn't work because it happens after setuid() call
|Reported by:||anonymous||Owned by:||anonymous|
Switch the order of the two calls. Per the documentation (on freebsd at least) for setgid():
The setgid() function is permitted if the specified ID is equal to the real group ID or the effective group ID of the process, or if the effective user ID is that of the super user.
So if you call setgid() first, the uid of the proc is still root and it will work. I noticed this b/c I own my project dir, but have it group www-data writeable and that wasn't working.