git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] shell: Rewrite documentation and improve error message
@ 2010-08-20 19:44 Ramkumar Ramachandra
  2010-08-20 19:51 ` Ramkumar Ramachandra
  2010-08-22  6:00 ` Greg Brockman
  0 siblings, 2 replies; 10+ messages in thread
From: Ramkumar Ramachandra @ 2010-08-20 19:44 UTC (permalink / raw)
  To: Git List; +Cc: Greg Brockman, Petr Baudis, Junio C Hamano

Update the documentation of 'git shell' to mention the interactive
mode and COMMAND_DIR. Also provide a hint when interactive mode is not
available in the shell.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Greg Brockman <gdb@MIT.EDU>
Cc: Petr Baudis <pasky@suse.cz>
---
 Documentation/git-receive-pack.txt |    2 +-
 Documentation/git-shell.txt        |   27 ++++++++++++++++-----------
 shell.c                            |    7 +++++--
 3 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/Documentation/git-receive-pack.txt b/Documentation/git-receive-pack.txt
index 2790eeb..2b07e44 100644
--- a/Documentation/git-receive-pack.txt
+++ b/Documentation/git-receive-pack.txt
@@ -8,7 +8,7 @@ git-receive-pack - Receive what is pushed into the repository
 
 SYNOPSIS
 --------
-'git-receive-pack' <directory>
+'git receive-pack' <directory>
 
 DESCRIPTION
 -----------
diff --git a/Documentation/git-shell.txt b/Documentation/git-shell.txt
index 0f3ad81..c9f1dc9 100644
--- a/Documentation/git-shell.txt
+++ b/Documentation/git-shell.txt
@@ -3,24 +3,29 @@ git-shell(1)
 
 NAME
 ----
-git-shell - Restricted login shell for GIT-only SSH access
+git-shell - Restricted login shell for Git-only SSH access
 
 
 SYNOPSIS
 --------
-'$(git --exec-path)/git-shell' -c <command> <argument>
+'git shell' [-c <command> <argument>]
 
 DESCRIPTION
 -----------
-This is meant to be used as a login shell for SSH accounts you want
-to restrict to GIT pull/push access only. It permits execution only
-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 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').
+
+A login shell for SSH accounts to provide restricted Git access. When
+'-c' is given, the program executes <command> non-interactively;
+<command> can be one of 'git receive-pack', 'git upload-pack', 'git
+upload-archive', 'cvs server', or a command in COMMAND_DIR. The shell
+is started in interactive mode when no arguments are given; in this
+case, COMMAND_DIR must exist, and any of the executables in them can
+be invoked.
+
+'cvs server' is a special command which executes git-cvsserver.
+
+COMMAND_DIR is the path 'git-shell-commands' in the user's home
+directory. The user must have read and execute permissions to the
+directory for it to be useful.
 
 Author
 ------
diff --git a/shell.c b/shell.c
index ffed615..3fb804e 100644
--- a/shell.c
+++ b/shell.c
@@ -152,8 +152,11 @@ int main(int argc, char **argv)
 	} else if (argc == 1) {
 		/* Allow the user to run an interactive shell */
 		cd_to_homedir();
-		if (access(COMMAND_DIR, R_OK | X_OK) == -1)
-			die("Sorry, the interactive git-shell is not enabled");
+		if (access(COMMAND_DIR, R_OK | X_OK) == -1) {
+			die("Inteactive git shell is not enabled.\n"
+			    "hint: " COMMAND_DIR " should exist "
+			    "and have read and execute access.");
+		}
 		run_shell();
 		exit(0);
 	} else if (argc != 3 || strcmp(argv[1], "-c")) {
-- 
1.7.2.2.409.gdbb11.dirty

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-24 19:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-20 19:44 [PATCH] shell: Rewrite documentation and improve error message Ramkumar Ramachandra
2010-08-20 19:51 ` Ramkumar Ramachandra
2010-08-22  6:00 ` Greg Brockman
2010-08-22  8:04   ` [PATCH v2] " Ramkumar Ramachandra
2010-08-23 17:42     ` Greg Brockman
2010-08-24  5:36       ` [PATCH v3] " Ramkumar Ramachandra
2010-08-24  5:43         ` Greg Brockman
2010-08-24 12:35           ` Ramkumar Ramachandra
2010-08-24 15:22             ` Greg Brockman
2010-08-24 19:01               ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).