From: Guenter Knauf Date: Tue, 9 Apr 2013 14:59:57 +0000 (+0200) Subject: Fixed lost OpenSSL output with "-t". X-Git-Tag: curl-7_30_0~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88535d593e202a0fb85d59f849d114034561b059;p=thirdparty%2Fcurl.git Fixed lost OpenSSL output with "-t". The OpenSSL pipe wrote to the final CA bundle file, but the encoded PEM output wrote to a temporary file. Consequently, the OpenSSL output was lost when the temp file was renamed to the final file at script finish (overwriting the final file written earlier by openssl). Patch posted to the list by Richard Michael (rmichael edgeofthenet org). --- diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl index 2eeefff0bb..188c939cb4 100755 --- a/lib/mk-ca-bundle.pl +++ b/lib/mk-ca-bundle.pl @@ -203,9 +203,9 @@ while () { print CRT $pem; } if ($opt_t) { - open(TMP, "|$openssl x509 -md5 -fingerprint -text -inform PEM >> $crt") or die "Couldn't open openssl pipe: $!\n"; - print TMP $pem; - close(TMP) or die "Couldn't close openssl pipe: $!\n"; + my $openssl_output = `echo '$pem' | $openssl x509 -md5 -fingerprint -text -inform PEM` or + die "Couldn't run openssl : $?\n"; + print CRT $openssl_output; } print STDERR "Parsing: $caname\n" if ($opt_v); $certnum ++;