Re: [PATCHv4] Add contrib/credentials/netrc with GPG support

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

 



On Tue, 05 Feb 2013 14:09:58 -0800 Junio C Hamano <gitster@xxxxxxxxx> wrote: 

JCH> open $io, "-|", qw(gpg --decrypt), $ARGV[0]

OK, the below will be in PATCHv6 (I'll wait on mailing it until after
you've reviewed the rest of PATCHv5).  Thanks for checking... I must
have had a typo or a missing comma or something, I could swear I tried
exactly what you show.

Ted


diff --git a/contrib/credential/netrc/git-credential-netrc b/contrib/credential/netrc/git-credential-netrc
index 8298564..5f91630 100755
--- a/contrib/credential/netrc/git-credential-netrc
+++ b/contrib/credential/netrc/git-credential-netrc
@@ -230,13 +230,9 @@ sub load_netrc {
 
 	my $io;
 	if ($gpgmode) {
-		# typical shell character escapes from http://www.slac.stanford.edu/slac/www/resource/how-to-use/cgi-rexx/cgi-esc.html
-		my $f = $file;
-		$f =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g;
-		# GPG doesn't work well with 2- or 3-argument open
-		my $cmd = "gpg --decrypt $f";
-		log_verbose("Using GPG to open $file: [$cmd]");
-		open $io, "$cmd|";
+		my @cmd = (qw(gpg --decrypt), $file);
+		log_verbose("Using GPG to open $file: [@cmd]");
+		open $io, "-|", @cmd;
 	}
 	else {
 		log_verbose("Opening $file...");
--
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]