From 720729e4b44b770b6e5f13e8e0ca34d0ebf83a08 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 13 Apr 2012 13:58:40 +0530 Subject: [PATCH] (minor) do not run `gitolite query-rc` from *perl* programs! I must have blindly converted from some shell-thinking/shell-code for these to have slipped through! (found when doing an audit of all system, exec, ``, qx, and tsh_) --- src/commands/sskm | 4 ++-- src/triggers/post-compile/ssh-authkeys | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/commands/sskm b/src/commands/sskm index a198dd0..d465816 100755 --- a/src/commands/sskm +++ b/src/commands/sskm @@ -13,8 +13,8 @@ in doc/sskm.mkd or online at http://sitaramc.github.com/gitolite/sskm.html. usage() if @ARGV and $ARGV[0] eq '-h'; -my $rb = `gitolite query-rc -n GL_REPO_BASE`; -my $ab = `gitolite query-rc -n GL_ADMIN_BASE`; +my $rb = $rc{GL_REPO_BASE}; +my $ab = $rc{GL_ADMIN_BASE}; # get to the keydir _chdir("$ab/keydir"); diff --git a/src/triggers/post-compile/ssh-authkeys b/src/triggers/post-compile/ssh-authkeys index 585ea35..7fd1e03 100755 --- a/src/triggers/post-compile/ssh-authkeys +++ b/src/triggers/post-compile/ssh-authkeys @@ -16,11 +16,11 @@ $|++; tsh_try("sestatus"); my $selinux = ( tsh_text() =~ /enabled/ ); -my $ab = `gitolite query-rc -n GL_ADMIN_BASE`; +my $ab = $rc{GL_ADMIN_BASE}; trace( 2, "'keydir' not found in '$ab'; exiting" ), exit if not -d "$ab/keydir"; my $akdir = "$ENV{HOME}/.ssh"; my $akfile = "$ENV{HOME}/.ssh/authorized_keys"; -my $glshell = `gitolite query-rc -n GL_BINDIR` . "/gitolite-shell"; +my $glshell = $rc{GL_BINDIR} . "/gitolite-shell"; my $auth_options = auth_options(); sanity(); @@ -76,8 +76,7 @@ sub sanity { } sub auth_options { - my $auth_options = `gitolite query-rc AUTH_OPTIONS`; - chomp($auth_options); + my $auth_options = $rc{AUTH_OPTIONS}; $auth_options ||= "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty"; return $auth_options;