git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Apr 29, 2011, 13:09 UTC
Message-ID
<m2oc3pxkyo.fsf_-_@igel.home>
In-Reply-To
<m2sjt1xpfj.fsf@igel.home>

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@linux-m68k.org>
---
 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@mea.tmt.tele.fi:/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@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Andreas SchwabNext: Junio C Hamano
Message 7 of 8 in “cvsimport does not work with passwords ?”
  1. Marcin WiśnickiApr 28, 2011
  2. Marcin WiśnickiApr 28, 2011
  3. Marcin WiśnickiApr 28, 2011
  4. Jeff KingApr 28, 2011
  5. Marcin WiśnickiApr 28, 2011
  6. Andreas SchwabApr 29, 2011
  7. git-cvsimport: normalize hostname for password lookupAndreas Schwab, Apr 29, 2011
  8. Junio C HamanoApr 29, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.