From 03bd0d601ea842b2db5bd40a1f7f036989f9b517 Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Wed, 30 Dec 2009 13:35:31 -0600 Subject: CVS Server: Support reading base and roots from environment The Gitosis single-account Git/ssh hosting system runs git commands through git-shell after confirming that the connecting user is authorized to access the requested repository. This works well for upload-pack and receive-pack, which take a repository argument through git-shell. This doesn't work so well for `cvs server', which is passed through literally, with no arguments. Allowing arguments risks sneaking in `--export-all', so that restriction should be maintained. Despite that, passing a repository root is necessary for per-user access control by the hosting software, and passing a base path improves usability without weakening security. Thus, git-cvsserver needs to come up with these values at runtime by some other means. Since git-shell preserves the environment for other purposes, the environment can carry these arguments as well. Thus, modify git-cvsserver to read $GIT_CVSSERVER_{BASE_PATH,ROOT} in the absence of equivalent command line arguments. Signed-off-by: Phil Miller Signed-off-by: Junio C Hamano --- Documentation/git-cvsserver.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index 99a7c1470..fbab29550 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -277,6 +277,21 @@ In `dbdriver` and `dbuser` you can use the following variables: If no name can be determined, the numeric uid is used. +ENVIRONMENT +----------- + +These variables obviate the need for command-line options in some +circumstances, allowing easier restricted usage through git-shell. + +GIT_CVSSERVER_BASE_PATH takes the place of the argument to --base-path. + +GIT_CVSSERVER_ROOT specifies a single-directory whitelist. The +repository must still be configured to allow access through +git-cvsserver, as described above. + +When these environment variables are set, the corresponding +command-line arguments may not be used. + Eclipse CVS Client Notes ------------------------ -- cgit v1.2.1