summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-04-09 11:55:19 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-04-09 11:55:19 +0100
commit93f36f49ff6a92f307e1eacbdd91673734ca7dc5 (patch)
treeb858916e26e0b1d013fe62f04aa4068056582079
parenta880701ddeadf5a2280a9d5ab710e29c86db09bc (diff)
downloadgitano-93f36f49ff6a92f307e1eacbdd91673734ca7dc5.tar.bz2
Ensure we pass the repo through otherwise HTTP commands might not work
-rwxr-xr-xbin/gitano-command.cgi.in7
-rw-r--r--lib/gitano/auth.lua2
2 files changed, 5 insertions, 4 deletions
diff --git a/bin/gitano-command.cgi.in b/bin/gitano-command.cgi.in
index ba16538..1954635 100755
--- a/bin/gitano-command.cgi.in
+++ b/bin/gitano-command.cgi.in
@@ -29,7 +29,7 @@ function url_decode(str)
return str
end
-function run_command(cmd, cmdline, parsed_cmdline, user, config, env)
+function run_command(cmd, cmdline, parsed_cmdline, user, config, env, repo)
gitano.log.debug("Welcome to " .. config.global.site_name)
gitano.log.debug("Running:")
for i = 1, #parsed_cmdline do
@@ -73,11 +73,12 @@ if os.getenv("QUERY_STRING") then
gitano.log.buffer_output()
- local authorized, cmd, parsed_cmdline, config, env =
+ local authorized, cmd, parsed_cmdline, config, env, repo =
gitano.auth.is_authorized(user, "http", cmdline)
if authorized then
- local exit = run_command(cmd, cmdline, parsed_cmdline, user, config, env)
+ local exit = run_command(cmd, cmdline, parsed_cmdline,
+ user, config, env, repo)
stdout:write("Status: " .. (exit == 0 and "200 OK" or "400 Bad request")
.. "\r\n\r\n")
diff --git a/lib/gitano/auth.lua b/lib/gitano/auth.lua
index 8f288e6..8c3a4e6 100644
--- a/lib/gitano/auth.lua
+++ b/lib/gitano/auth.lua
@@ -127,7 +127,7 @@ local function is_authorized(user, source, cmdline)
log.critical("Ruleset denied action. Sorry.")
end
- return authorized, cmd, parsed_cmdline, admin_conf, env
+ return authorized, cmd, parsed_cmdline, admin_conf, env, repo
end
return {