cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] mk-ca-bundle.pl: Fix clobbered openssl output.

From: Richard Michael <rmichael_at_edgeofthenet.org>
Date: Thu, 4 Apr 2013 12:39:41 +0200

Output during mk-ca-bundle.pl is written to a temporary file which is
renamed to the final file after the certificate processing loop
terminates.

When passing "-t" to roundtrip certificates through OpenSSL, the
output from openssl is erroneously written to the final file during
the loop then consequently lost when the temporary file is renamed
over top of the final file.

The problem becomes that both the mk-ca-bundle and the subshell write
to the temporary output file. I tried autoflushing, but there's no
getting around two processes writing to the same file.

IPC::Run does not appear to part of a Perl standard distribution, so I
didn't fix this with a bidirectional pipe/filehandle.

Instead, do a simple fix capturing openssl's output, then write it to
the open temporary file.

Hardly worth this much discussion. ;-)

Regards
Received on 2013-04-04