summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 2d49370..496f3a1 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -20,8 +20,15 @@ class GitlabShell
if validate_access
process_cmd
+ else
+ message = "gitlab-shell: Access denied for git command <#{@origin_cmd}>"
+ message << " by user with key #{@key_id}."
+ $logger.warn message
end
else
+ message = "gitlab-shell: Attempt to execute disallowed command "
+ message << "<#{@origin_cmd}> by user with key #{@key_id}."
+ $logger.warn message
puts 'Not allowed command'
end
else
@@ -44,7 +51,9 @@ class GitlabShell
def process_cmd
repo_full_path = File.join(repos_path, repo_name)
- exec_cmd "#{@git_cmd} #{repo_full_path}"
+ cmd = "#{@git_cmd} #{repo_full_path}"
+ $logger.info "gitlab-shell: executing git command <#{cmd}> for user with key #{@key_id}."
+ exec_cmd(cmd)
end
def validate_access