Call setuid/setgid in script/git-proxy
authorMarius Mathiesen <marius@gitorious.org>
Tue, 2 Oct 2012 11:08:33 +0000 (13:08 +0200)
committerMarius Mathiesen <marius@gitorious.org>
Tue, 2 Oct 2012 11:08:33 +0000 (13:08 +0200)
commit7679b64cc04f9c21ba4ca9710b91e8bdbd9338ac
treef25a32317d330ab6434af8db0ede2cb3985fb5f1
parent087b8315bf1a1679761c26717e78402066a6b1c4
Call setuid/setgid in script/git-proxy

In able to use the git proxy from Upstart (in Upstart versions which
don't support setgid/setuid themselves) without needing an extra
shell (su -c or equivalent) we might as well do this ourselves.

If all these conditions are met:
- RAILS_ENV=production
- We're running as root
- gitorious.yml specifies gitorious_user

we will switch the script to the gid and uid of the specified user.
script/git-proxy