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

Re: [PATCH] git-shell and git-cvsserver

From
Frank Lichtenheld <frank@lichtenheld.de>
Date
Oct 5, 2007, 15:07 UTC
Message-ID
<20071005150717.GN31659@planck.djpig.de>
In-Reply-To
<200710051453.47622.wielemak@science.uva.nl>
On Fri, Oct 05, 2007 at 02:53:47PM +0200, Jan Wielemaker wrote:
Show 30 quoted lines
> +#define EXEC_PATH "/usr/local/bin"
> +
> +static int do_cvs_cmd(const char *me, char *arg)
> +{
> +	const char *my_argv[4];
> +	const char *oldpath;
> +
> +	if ( !arg )
> +		die("no argument");
> +	if ( strcmp(arg, "server") )
> +		die("only allows git-cvsserver server: %s", arg);
> +
> +	my_argv[0] = "cvsserver";
> +	my_argv[1] = "server";
> +	my_argv[2] = NULL;
> +
> +	if ( (oldpath=getenv("PATH")) ) {
> +		char *newpath = malloc(strlen(oldpath)+strlen(EXEC_PATH)+5+1+1);
> +		
> +		sprintf(newpath, "PATH=%s:%s", EXEC_PATH, oldpath);
> +		putenv(newpath);
> +	} else {
> +		char *newpath = malloc(strlen(EXEC_PATH)+5+1);
> +		
> +		sprintf(newpath, "PATH=%s", EXEC_PATH);
> +		putenv(newpath);
> +	}
> +
> +	return execv_git_cmd(my_argv);
> +}
This seems to be mostly a duplication of prepend_to_path from git.c
Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/
Previous: Miklos VajnaNext: Johannes Schindelin
Message 3 of 10 in “git-shell and git-cvsserver”
  1. git-shell and git-cvsserverJan Wielemaker, Oct 5, 2007
  2. Miklos VajnaOct 5, 2007
  3. Frank LichtenheldOct 5, 2007
  4. Johannes SchindelinOct 8, 2007
  5. Jan WielemakerOct 8, 2007
  6. Johannes SchindelinOct 9, 2007
  7. Support cvs via git-shellJohannes Schindelin, Oct 9, 2007
  8. Frank LichtenheldOct 9, 2007
  9. Johannes SchindelinOct 10, 2007
  10. Frank LichtenheldOct 10, 2007

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.