git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Lichtenheld <frank@lichtenheld.de>
To: Jan Wielemaker <wielemak@science.uva.nl>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] git-shell and git-cvsserver
Date: Fri, 5 Oct 2007 17:07:17 +0200	[thread overview]
Message-ID: <20071005150717.GN31659@planck.djpig.de> (raw)
In-Reply-To: <200710051453.47622.wielemak@science.uva.nl>

On Fri, Oct 05, 2007 at 02:53:47PM +0200, Jan Wielemaker wrote:
> +#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/

  parent reply	other threads:[~2007-10-05 15:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-05 12:53 [PATCH] git-shell and git-cvsserver Jan Wielemaker
2007-10-05 14:31 ` Miklos Vajna
2007-10-05 15:07 ` Frank Lichtenheld [this message]
2007-10-08  4:51 ` Johannes Schindelin
2007-10-08 14:22   ` Jan Wielemaker
2007-10-09 11:51     ` Johannes Schindelin
2007-10-09 14:33 ` [PATCH] Support cvs via git-shell Johannes Schindelin
2007-10-09 22:35   ` Frank Lichtenheld
2007-10-10 13:29     ` Johannes Schindelin
2007-10-10 19:10       ` Frank Lichtenheld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071005150717.GN31659@planck.djpig.de \
    --to=frank@lichtenheld.de \
    --cc=git@vger.kernel.org \
    --cc=wielemak@science.uva.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).