Fix exit codes for allowed ssh commands

gitolite specific ssh commands ("getperms", "setperms", "info" etc.)
should exit with non-error code in case of success.

Also "get/setperms" should print to STDOUT instead of STDERR.

This change is specially needed for the gitolite-tools
(http://github.com/tmatilai/gitolite-tools) to work.

Signed-off-by: Teemu Matilainen <teemu.matilainen@reaktor.fi>
This commit is contained in:
Teemu Matilainen 2010-01-08 14:05:11 +02:00 committed by Sitaram Chamarty
parent 5ad2056a9c
commit 15475f666c
2 changed files with 5 additions and 5 deletions

View file

@ -137,11 +137,11 @@ sub get_set_perms
wrap_chdir("$repo_base_abs");
wrap_chdir("$repo.git");
if ($verb eq 'getperms') {
print STDERR `cat gl-perms 2>/dev/null`;
system("cat", "gl-perms") if -f "gl-perms";
} else {
system("cat > gl-perms");
print STDERR "New perms are:\n";
print STDERR `cat gl-perms`;
print "New perms are:\n";
system("cat", "gl-perms");
}
}