{"thread":{"id":"27212","subject":"cvsimport does not work with passwords ?","startedAt":"2011-04-28T20:59:57Z","lastAt":"2011-04-29T16:33:38Z","messageCount":8,"participants":["Marcin Wiśnicki","Jeff King","Andreas Schwab","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166688","messageId":"ipckgd$krd$2@dough.gmane.org","threadId":"27212","inReplyTo":null,"subject":"cvsimport does not work with passwords ?","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-04-28T20:59:57Z","receivedAt":"2011-04-28T20:59:57Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"I have to import part of public cvs repository that is protected by \npassword (which is \"anoncvs\"):\n\n> export CVSROOT=:pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs\n> cvs login\n\nAnd now I can use cvs and cvsps, when I try git however:\n\n> git cvsimport -vk projects/pkgtools\nAuthReply: I HATE YOU\n\nIt seems that it does not send the password. From captured network \nconversation:\n\n-> BEGIN AUTH REQUEST\n-> /home/ncvs\n-> anoncvs\n-> A\n-> END AUTH REQUEST\n<- I HATE YOU\n\nBut `cat ~/.cvspass`:\n/1 :pserver:anoncvs@anoncvs.fr.freebsd.org:2401/home/ncvs Ay=0=h<Z\n\n\nSo why is git not sending the password ?\n"},{"id":"166689","messageId":"ipcknp$krd$3@dough.gmane.org","threadId":"27212","inReplyTo":"ipckgd$krd$2@dough.gmane.org","subject":"Re: cvsimport does not work with passwords ?","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-04-28T21:03:53Z","receivedAt":"2011-04-28T21:03:53Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"On Thu, 28 Apr 2011 20:59:57 +0000, Marcin Wiśnicki wrote:\n\n>> git cvsimport -vk projects/pkgtools\n> AuthReply: I HATE YOU\n> \n\nForgot to mention:\n\n> git --version\ngit version 1.7.4.4\n"},{"id":"166693","messageId":"ipcmjp$krd$4@dough.gmane.org","threadId":"27212","inReplyTo":"ipckgd$krd$2@dough.gmane.org","subject":"Re: cvsimport does not work with passwords ?","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-04-28T21:35:53Z","receivedAt":"2011-04-28T21:35:53Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"On Thu, 28 Apr 2011 20:59:57 +0000, Marcin Wiśnicki wrote:\n\n> I have to import part of public cvs repository that is protected by\n> password (which is \"anoncvs\"):\n> \n>> export CVSROOT=:pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs cvs\n>> login\n> \n\nI have tried another mirror that uses ssh:\n\n> export CVSROOT=:ext:anoncvs@anoncvs1.FreeBSD.org:/home/ncvs\n> export SSH_RSH=ssh\n\nAnd this also does not work because git tries to use rsh.\nAccording to google this should work.\n\nAny ideas why cvsimport is so broken for me ?\n"},{"id":"166697","messageId":"20110428224510.GA16065@sigill.intra.peff.net","threadId":"27212","inReplyTo":"ipcmjp$krd$4@dough.gmane.org","subject":"Re: cvsimport does not work with passwords ?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-04-28T22:45:10Z","receivedAt":"2011-04-28T22:45:10Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 28, 2011 at 09:35:53PM +0000, Marcin Wiśnicki wrote:\n\n> I have tried another mirror that uses ssh:\n> \n> > export CVSROOT=:ext:anoncvs@anoncvs1.FreeBSD.org:/home/ncvs\n> > export SSH_RSH=ssh\n> \n> And this also does not work because git tries to use rsh.\n> According to google this should work.\n> \n> Any ideas why cvsimport is so broken for me ?\n\nIt has (thankfully) been a long time since I've had to touch CVS, but\nshouldn't that be CVS_RSH on the second line?\n\n-Peff\n"},{"id":"166698","messageId":"ipcr0c$jc3$1@dough.gmane.org","threadId":"27212","inReplyTo":"20110428224510.GA16065@sigill.intra.peff.net","subject":"Re: cvsimport does not work with passwords ?","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-04-28T22:50:53Z","receivedAt":"2011-04-28T22:50:53Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"On Thu, 28 Apr 2011 18:45:10 -0400, Jeff King wrote:\n\n> On Thu, Apr 28, 2011 at 09:35:53PM +0000, Marcin Wiśnicki wrote:\n> \n>> I have tried another mirror that uses ssh:\n>> \n>> > export CVSROOT=:ext:anoncvs@anoncvs1.FreeBSD.org:/home/ncvs export\n>> > SSH_RSH=ssh\n>> \n>> And this also does not work because git tries to use rsh. According to\n>> google this should work.\n>> \n>> Any ideas why cvsimport is so broken for me ?\n> \n> It has (thankfully) been a long time since I've had to touch CVS, but\n> shouldn't that be CVS_RSH on the second line?\n> \n> -Peff\n\nAhh yes indeed. I made a silly typo, now it works.\n"},{"id":"166729","messageId":"m2sjt1xpfj.fsf@igel.home","threadId":"27212","inReplyTo":"ipckgd$krd$2@dough.gmane.org","subject":"Re: cvsimport does not work with passwords ?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2011-04-29T11:33:20Z","receivedAt":"2011-04-29T11:33:20Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Marcin Wiśnicki <mwisnicki@gmail.com> writes:\n\n>> export CVSROOT=:pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs\n> /1 :pserver:anoncvs@anoncvs.fr.freebsd.org:2401/home/ncvs Ay=0=h<Z\n\nNote the different case.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"166734","messageId":"m2oc3pxkyo.fsf_-_@igel.home","threadId":"27212","inReplyTo":"m2sjt1xpfj.fsf@igel.home","subject":"[PATCH] git-cvsimport: normalize hostname for password lookup","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2011-04-29T13:09:51Z","receivedAt":"2011-04-29T13:09:51Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"When looking up the pserver password in .cvspass normalize the hostname\npart of the address by converting it to lowercase.\n\nSigned-off-by: Andreas Schwab <schwab@linux-m68k.org>\n---\n git-cvsimport.perl |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex bbf327f..046fe32 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -249,6 +249,8 @@ sub conn {\n \n \t\t# if username is not explicit in CVSROOT, then use current user, as cvs would\n \t\t$user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || \"anonymous\") unless $user;\n+\t\t# Normalize hostname for lookup in .cvspass\n+\t\t$serv = lc $serv;\n \t\tmy $rr2 = \"-\";\n \t\tunless ($port) {\n \t\t\t$rr2 = \":pserver:$user\\@$serv:$repo\";\n@@ -263,6 +265,8 @@ sub conn {\n \t\t\t\t# :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z\n \t\t\t\twhile (<H>) {\n \t\t\t\t\tchomp;\n+\t\t\t\t\t# FIXME: entries without version prefix\n+\t\t\t\t\t# may need to be normalized\n \t\t\t\t\ts/^\\/\\d+\\s+//;\n \t\t\t\t\tmy ($w,$p) = split(/\\s/,$_,2);\n \t\t\t\t\tif ($w eq $rr or $w eq $rr2) {\n-- \n1.7.5\n\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"166751","messageId":"7v4o5hxbj1.fsf@alter.siamese.dyndns.org","threadId":"27212","inReplyTo":"m2oc3pxkyo.fsf_-_@igel.home","subject":"Re: [PATCH] git-cvsimport: normalize hostname for password lookup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-29T16:33:38Z","receivedAt":"2011-04-29T16:33:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> diff --git a/git-cvsimport.perl b/git-cvsimport.perl\n> index bbf327f..046fe32 100755\n> --- a/git-cvsimport.perl\n> +++ b/git-cvsimport.perl\n> @@ -249,6 +249,8 @@ sub conn {\n>  \n>  \t\t# if username is not explicit in CVSROOT, then use current user, as cvs would\n>  \t\t$user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || \"anonymous\") unless $user;\n> +\t\t# Normalize hostname for lookup in .cvspass\n> +\t\t$serv = lc $serv;\n>  \t\tmy $rr2 = \"-\";\n>  \t\tunless ($port) {\n>  \t\t\t$rr2 = \":pserver:$user\\@$serv:$repo\";\n> @@ -263,6 +265,8 @@ sub conn {\n>  \t\t\t\t# :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z\n>  \t\t\t\twhile (<H>) {\n>  \t\t\t\t\tchomp;\n> +\t\t\t\t\t# FIXME: entries without version prefix\n> +\t\t\t\t\t# may need to be normalized\n>  \t\t\t\t\ts/^\\/\\d+\\s+//;\n>  \t\t\t\t\tmy ($w,$p) = split(/\\s/,$_,2);\n>  \t\t\t\t\tif ($w eq $rr or $w eq $rr2) {\n\nIf I correctly recall what I found out from cvs's changelog while looking at\nhttp://thread.gmane.org/gmane.comp.version-control.git/163979/focus=167178 \nI think the versioned entries are already downcased, so the above,\nincluding the \"FIXME\", looks correct.\n\nAs I wrote in another message in that thread, I think this codepath should\nbe refactored a bit better so that it can handle subtle differences\nbetween versions and implementations of cvs itself, and also these\nversioned entries.  A good first step might be to separate out the body of\nthe innermost loop we see here that process one entry from the cvspass\nfile into a helper function.\n\nCan you give an eyeball on the update of 077aac1 (Look for password in\nboth CVS and CVSNT password files., 2011-02-18) posted by Guy Rouillier\ntoday and help testing it, and put this fix on top that?\n\nThanks.\n"}]}