cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Guenter <lists_at_gknw.net>
Date: Thu, 04 Apr 2013 22:42:32 +0200

On 04.04.2013 12:39, Richard Michael wrote:
> 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. ;-)

well, its always good though to explain what you see happen and why your
patch is needed!
I'm sure that the script worked initially when I wrote it (long ago)
since I did a fair amount of testing also with the -t flag; so I assume
the breakage came a while ago when someone else introduced the print
splitting to STDOUT / STDERR and a couple of other modifications;
obviously nobody of us did test this patch with openssl ... ;-)
thanks for your patch! I hope I can take a look at it this weekend ...

Gün.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-04