git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-shell: Add 'git-upload-archive' to allowed commands.

From
EBErik Broes <erikbroes@ripe.net>
Date
Apr 9, 2009, 19:58 UTC
Message-ID
<49DE537C.8070907@ripe.net>

This allows for example gitosis to allow use of 'git archive --remote' in a controlled environment.

Signed-off-by: Erik Broes <erikbroes@ripe.net>
---

There were some questions on IRC raising (valid) concerns about security. If there is a dangling commit on the remote end and any user would know or guess the SHA, it could be retrieved where git-upload-pack will not allow so.

We were unable to find out if this was the original reason git-shell was never extended with git-upload-archive functionality or if it was a simple oversight. If it was the reason I'm not sure there is an easy way out.

 Documentation/git-shell.txt |    6 +++---
 shell.c                     |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-shell.txt b/Documentation/git-shell.txt
index 3f8d973..0f3ad81 100644
--- a/Documentation/git-shell.txt
+++ b/Documentation/git-shell.txt
@@ -18,9 +18,9 @@ of server-side GIT commands implementing the pull/push functionality.
 The commands can be executed only by the '-c' option; the shell is not
 interactive.

-Currently, only three commands are permitted to be called, 'git-receive-pack'
-'git-upload-pack' with a single required argument or 'cvs server' (to invoke
-'git-cvsserver').
+Currently, only four commands are permitted to be called, 'git-receive-pack'
+'git-upload-pack' and 'git-upload-archive' with a single required argument, or
+'cvs server' (to invoke 'git-cvsserver').

 Author
 ------
diff --git a/shell.c b/shell.c
index e339369..b968be7 100644
--- a/shell.c
+++ b/shell.c
@@ -40,6 +40,7 @@ static struct commands {
 } cmd_list[] = {
 	{ "git-receive-pack", do_generic_cmd },
 	{ "git-upload-pack", do_generic_cmd },
+	{ "git-upload-archive", do_generic_cmd },
 	{ "cvs", do_cvs_cmd },
 	{ NULL },
 };
-- 
1.6.2.1.519.gcf01bc
Next: Junio C Hamano
Message 1 of 4 in “git-shell: Add 'git-upload-archive' to allowed commands.”
  1. git-shell: Add 'git-upload-archive' to allowed commands.Erik Broes, Apr 9, 2009
  2. Junio C HamanoApr 11, 2009
  3. Erik BroesApr 12, 2009
  4. Björn SteinbrinkApr 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.