git_shell.rb revision c211711d5bdfe0a7fc95f3db09375c4376667cd4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
require 'open3'
@command = command
end
def exec
if @command
if GIT_CMDS.include?(@git_cmd)
else
message = "git-shell: Access denied for git command <#{@command}> by #{log_username}."
end
else
message = "git-shell: Attempt to execute disallowed command <#{@command}> by #{log_username}."
puts 'Not allowed command'
end
else
exit(1)
end
end
end
cmd = "#{@git_cmd} #{repo_full_path}"
end
end
end
end
# Can't use "@user ||=" because that will keep hitting the API when @user is really nil!
@user
else
end
end
end
# User identifier to be used in log messages.
end
end