* cvsimport and branches with "(" in the name
@ 2008-04-29 7:22 Nigel Magnay
2008-04-29 15:52 ` Jeff King
0 siblings, 1 reply; 4+ messages in thread
From: Nigel Magnay @ 2008-04-29 7:22 UTC (permalink / raw)
To: git
git 1.5.4.4 on ubuntu, I cvsimport a repository that has an oddly
named branch - I get
sh: Syntax error: "(" unexpected
Cannot write branch ChapelHill_3_0(iteration2)_esap_demo for update:
Bad file descriptor
though the end of my -v log shows
Tree ID 46f13621661205b02a80d7d431a2c59be500ae45
Parent ID d635ccf06e1cac3afacc4fba6e70bba7f771ead2
Committed patch 1956 (ChapelHill_3_0(iteration2)_esap_demo +0000
2006-12-04 10:28:31)
Commit ID 76c991af0c690d9ae5471c0b661dfba3b3df18c6
and refs/heads has a correctly named file
My guess is something in the guts isn't liking the ( character, when
committing the next patch.
Any ideas on how to diagnose / fix it further ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cvsimport and branches with "(" in the name
2008-04-29 7:22 cvsimport and branches with "(" in the name Nigel Magnay
@ 2008-04-29 15:52 ` Jeff King
2008-04-30 0:45 ` Morten Welinder
0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2008-04-29 15:52 UTC (permalink / raw)
To: Nigel Magnay; +Cc: git
On Tue, Apr 29, 2008 at 08:22:02AM +0100, Nigel Magnay wrote:
> git 1.5.4.4 on ubuntu, I cvsimport a repository that has an oddly
> named branch - I get
>
> sh: Syntax error: "(" unexpected
> Cannot write branch ChapelHill_3_0(iteration2)_esap_demo for update:
> Bad file descriptor
Looks like cvsimport is handing something as an argument to a git
command, but we accidentally involve the shell. Maybe here:
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) {
Does that fix it?
> Any ideas on how to diagnose / fix it further ?
If that doesn't work, you might try running with GIT_TRACE=1, and then
you can see which commands are being run when the error occurs.
-Peff
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: cvsimport and branches with "(" in the name
2008-04-29 15:52 ` Jeff King
@ 2008-04-30 0:45 ` Morten Welinder
2008-04-30 3:31 ` Jeff King
0 siblings, 1 reply; 4+ messages in thread
From: Morten Welinder @ 2008-04-30 0:45 UTC (permalink / raw)
To: Jeff King; +Cc: GIT Mailing List
> - system("git-update-ref $remote/$branch $cid") == 0
> + system('git-update-ref', "$remote/$branch", $cid) == 0
I hope there are no further such system calls left. This could run arbitrary
commands if one was tricked into importing an evil repository.
Morten
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cvsimport and branches with "(" in the name
2008-04-30 0:45 ` Morten Welinder
@ 2008-04-30 3:31 ` Jeff King
0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2008-04-30 3:31 UTC (permalink / raw)
To: Morten Welinder; +Cc: GIT Mailing List
On Tue, Apr 29, 2008 at 08:45:42PM -0400, Morten Welinder wrote:
> > - system("git-update-ref $remote/$branch $cid") == 0
> > + system('git-update-ref', "$remote/$branch", $cid) == 0
>
> I hope there are no further such system calls left. This could run arbitrary
> commands if one was tricked into importing an evil repository.
Yes, even if that doesn't fix his problem, it should still be changed. I
have confirmed that it's the only such one in git-cvsimport.
-Peff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-30 3:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29 7:22 cvsimport and branches with "(" in the name Nigel Magnay
2008-04-29 15:52 ` Jeff King
2008-04-30 0:45 ` Morten Welinder
2008-04-30 3:31 ` Jeff King
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).