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

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

 



When looking up the pserver password in .cvspass normalize the hostname
part of the address by converting it to lowercase.

Signed-off-by: Andreas Schwab <schwab@xxxxxxxxxxxxxx>
---
 git-cvsimport.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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) {
-- 
1.7.5


-- 
Andreas Schwab, schwab@xxxxxxxxxxxxxx
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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]