Re: [PATCH] git-cvsimport: normalize hostname for password lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Schwab <schwab@xxxxxxxxxxxxxx> writes:

> diff --git a/git-cvsimport.perl b/git-cvsimport.perl
> index bbf327f..046fe32 100755
> --- a/git-cvsimport.perl
> +++ b/git-cvsimport.perl
> @@ -249,6 +249,8 @@ sub conn {
>  
>  		# if username is not explicit in CVSROOT, then use current user, as cvs would
>  		$user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
> +		# Normalize hostname for lookup in .cvspass
> +		$serv = lc $serv;
>  		my $rr2 = "-";
>  		unless ($port) {
>  			$rr2 = ":pserver:$user\@$serv:$repo";
> @@ -263,6 +265,8 @@ sub conn {
>  				# :pserver:cvs@xxxxxxxxxxxxxxx:/cvsroot/zmailer Ah<Z
>  				while (<H>) {
>  					chomp;
> +					# FIXME: entries without version prefix
> +					# may need to be normalized
>  					s/^\/\d+\s+//;
>  					my ($w,$p) = split(/\s/,$_,2);
>  					if ($w eq $rr or $w eq $rr2) {

If I correctly recall what I found out from cvs's changelog while looking at
http://thread.gmane.org/gmane.comp.version-control.git/163979/focus=167178 
I think the versioned entries are already downcased, so the above,
including the "FIXME", looks correct.

As I wrote in another message in that thread, I think this codepath should
be refactored a bit better so that it can handle subtle differences
between versions and implementations of cvs itself, and also these
versioned entries.  A good first step might be to separate out the body of
the innermost loop we see here that process one entry from the cvspass
file into a helper function.

Can you give an eyeball on the update of 077aac1 (Look for password in
both CVS and CVSNT password files., 2011-02-18) posted by Guy Rouillier
today and help testing it, and put this fix on top that?

Thanks.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]