jbox-web/redmine_git_hosting — pull request #94 by illwieckz (2013-10-29 15:30:02+00:00)
Title: sudo fix

Hi,

This modification was needed to me to fix that: https://github.com/jbox-web/redmine_git_hosting/issues/92

The most important part is this:

< test = %x[#{shell_cmd_runner} sudo -nu
> test = %x[#{shell_cmd_runner} sudo -inu

The plugin does "sudo -i" everywhere but not here. It's a good idea to do that everywhere. With this the test is representative (and works as expected).

The part
< echo "yes"
> whoami
is less critical, but testing one word is better than failing to "escapement hell".

Outside this test, commands are run though a script that escapes correctly.