From 25978dd00e0a77b9fcc36264a6602510c7407dab Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Sun, 4 May 2014 11:36:05 +0100 Subject: Make gitano-command pass repo_root to is_authorized --- bin/gitano-command.cgi.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/gitano-command.cgi.in') diff --git a/bin/gitano-command.cgi.in b/bin/gitano-command.cgi.in index 1954635..681603b 100755 --- a/bin/gitano-command.cgi.in +++ b/bin/gitano-command.cgi.in @@ -74,7 +74,7 @@ if os.getenv("QUERY_STRING") then gitano.log.buffer_output() local authorized, cmd, parsed_cmdline, config, env, repo = - gitano.auth.is_authorized(user, "http", cmdline) + gitano.auth.is_authorized(user, "http", cmdline, os.getenv("GITANO_ROOT")) if authorized then local exit = run_command(cmd, cmdline, parsed_cmdline, -- cgit v1.2.1 From 7035283011cf3bd7deec82a61475c9e8edb5491d Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Sun, 4 May 2014 12:28:31 +0100 Subject: Make gitano-command cgi use runcmd --- bin/gitano-command.cgi.in | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'bin/gitano-command.cgi.in') diff --git a/bin/gitano-command.cgi.in b/bin/gitano-command.cgi.in index 681603b..2fa1db2 100755 --- a/bin/gitano-command.cgi.in +++ b/bin/gitano-command.cgi.in @@ -29,26 +29,6 @@ function url_decode(str) return str end -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 - gitano.log.debug(" => " .. parsed_cmdline[i]) - end - gitano.log.debug("") - gitano.log.debug("On behalf of " .. user .. " using key " .. env["GITANO_KEYTAG"]) - - local how, why = cmd.run(config, repo, parsed_cmdline, env) - - if how ~= "exit" or why ~= 0 then - gitano.log.critical("Error running " .. parsed_cmdline[1] .. ": " .. how) - return why - else - gitano.log.syslog.info(cmdline, "completed successfully") - return 0 - end -end - if os.getenv("QUERY_STRING") then local query_string = url_decode(os.getenv("QUERY_STRING")) local cmdline = query_string @@ -77,7 +57,7 @@ if os.getenv("QUERY_STRING") then gitano.auth.is_authorized(user, "http", cmdline, os.getenv("GITANO_ROOT")) if authorized then - local exit = run_command(cmd, cmdline, parsed_cmdline, + local exit = gitano.util.run_command(cmd, cmdline, parsed_cmdline, user, config, env, repo) stdout:write("Status: " .. (exit == 0 and "200 OK" or "400 Bad request") -- cgit v1.2.1