From 86166f7adc60f191b145818eda56d095aca7ed7f Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Thu, 4 Feb 2010 15:16:47 +0530 Subject: [PATCH] $shell_allowed needs to be passed to specal_cmds brought on by realising that you lost $shell_allowed when refactoring (previous commit) but perl hadn't caught it because -- damn -- you didn't have "use strict" in gitolite.pm --- src/gitolite.pm | 18 +++++++++++------- src/gl-auth-command | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/gitolite.pm b/src/gitolite.pm index a8127e9..a6dba92 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -1,3 +1,4 @@ +use strict; # this file is commonly used using "require". It is not required to use "use" # (because it doesn't live in a different package) @@ -17,16 +18,19 @@ # common definitions # ---------------------------------------------------------------------------- -$ABRT = "\n\t\t***** ABORTING *****\n "; -$WARN = "\n\t\t***** WARNING *****\n "; +our $ABRT = "\n\t\t***** ABORTING *****\n "; +our $WARN = "\n\t\t***** WARNING *****\n "; # commands we're expecting -$R_COMMANDS=qr/^(git[ -]upload-pack|git[ -]upload-archive)$/; -$W_COMMANDS=qr/^git[ -]receive-pack$/; +our $R_COMMANDS=qr/^(git[ -]upload-pack|git[ -]upload-archive)$/; +our $W_COMMANDS=qr/^git[ -]receive-pack$/; # note that REPONAME_PATT allows "/", while USERNAME_PATT allows "@" -$REPONAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._/+-]*$); # very simple pattern -$USERNAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); # very simple pattern +our $REPONAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._/+-]*$); # very simple pattern +our $USERNAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); # very simple pattern + +our $REPO_UMASK; +our %repos; # ---------------------------------------------------------------------------- # convenience subs @@ -163,7 +167,7 @@ sub report_basic sub special_cmd { - my ($GL_ADMINDIR, $GL_CONF_COMPILED, $RSYNC_BASE, $HTPASSWD_FILE) = @_; + my ($GL_ADMINDIR, $GL_CONF_COMPILED, $shell_allowed, $RSYNC_BASE, $HTPASSWD_FILE) = @_; my $cmd = $ENV{SSH_ORIGINAL_COMMAND}; my $user = $ENV{GL_USER}; diff --git a/src/gl-auth-command b/src/gl-auth-command index 8aa2f65..48c67be 100755 --- a/src/gl-auth-command +++ b/src/gl-auth-command @@ -114,7 +114,7 @@ unless ($ENV{SSH_ORIGINAL_COMMAND}) { my ($verb, $repo) = ($ENV{SSH_ORIGINAL_COMMAND} =~ /^\s*(git\s+\S+|\S+)\s+'\/?(.*?)(?:\.git)?'/); unless ( $verb and ( $verb =~ $R_COMMANDS or $verb =~ $W_COMMANDS ) and $repo and $repo =~ $REPONAME_PATT ) { # ok, it's not a normal git command; call the special command helper - &special_cmd ($GL_ADMINDIR, $GL_CONF_COMPILED, $RSYNC_BASE, $HTPASSWD_FILE); + &special_cmd ($GL_ADMINDIR, $GL_CONF_COMPILED, $shell_allowed, $RSYNC_BASE, $HTPASSWD_FILE); exit; }