# [PATCH] cvsimport: always pass user data to "system" as a list

2 messages from 2008-04-30 to 2008-04-30. Participants: Jeff King, Nigel Magnay.
Thread: https://gitlist.dev/t/13326

## Jeff King, 2008-04-30 04:36

Subject: [PATCH] cvsimport: always pass user data to "system" as a list
Message-ID: <20080430043614.GA31019@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20080430043614.GA31019%40sigill.intra.peff.net

```
This avoids invoking the shell. Not only is it faster, but
it prevents the possibility of interpreting our arguments in
the shell.

Signed-off-by: Jeff King <peff@peff.net>
---
Nigel reported a problem with a CVS branch that had '(' in the name. No
report yet on whether this fixes it, but it should be done regardless.

I checked over git-cvsimport.perl, and this was the only instance I
found.

 git-cvsimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 95c5eec..bdac5d5 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -772,7 +772,7 @@ sub commit {
 	waitpid($pid,0);
 	die "Error running git-commit-tree: $?\n" if $?;
 
-	system("git-update-ref $remote/$branch $cid") == 0
+	system('git-update-ref', "$remote/$branch", $cid) == 0
 		or die "Cannot write branch $branch for update: $!\n";
 
 	if ($tag) {
-- 
1.5.5.1.178.gc1eb9.dirty

```

## Nigel Magnay, 2008-04-30 07:30

Subject: Re: [PATCH] cvsimport: always pass user data to "system" as a list
Message-ID: <320075ff0804300030q227cee39w28bfb8456a97995f@mail.gmail.com>
URL: https://gitlist.dev/e/320075ff0804300030q227cee39w28bfb8456a97995f%40mail.gmail.com
In-Reply-To: <20080430043614.GA31019@sigill.intra.peff.net>

```
This fixed my import problem - thanks for the swift identification (my
perl isn't so hot so it scared me :) )

On Wed, Apr 30, 2008 at 5:36 AM, Jeff King <peff@peff.net> wrote:
> This avoids invoking the shell. Not only is it faster, but
>  it prevents the possibility of interpreting our arguments in
>  the shell.
>
>  Signed-off-by: Jeff King <peff@peff.net>
>  ---
>  Nigel reported a problem with a CVS branch that had '(' in the name. No
>  report yet on whether this fixes it, but it should be done regardless.
>
>  I checked over git-cvsimport.perl, and this was the only instance I
>  found.
>
>   git-cvsimport.perl |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
>  diff --git a/git-cvsimport.perl b/git-cvsimport.perl
>  index 95c5eec..bdac5d5 100755
>  --- a/git-cvsimport.perl
>  +++ b/git-cvsimport.perl
>  @@ -772,7 +772,7 @@ sub commit {
>         waitpid($pid,0);
>         die "Error running git-commit-tree: $?\n" if $?;
>
>  -       system("git-update-ref $remote/$branch $cid") == 0
>  +       system('git-update-ref', "$remote/$branch", $cid) == 0
>                 or die "Cannot write branch $branch for update: $!\n";
>
>         if ($tag) {
>  --
>  1.5.5.1.178.gc1eb9.dirty
>
>

```
