Christian Weisgerber <na...@mips.inka.de> writes:

> On 2015-02-21, Jérémie Courrèges-Anglas <j...@wxcvbn.org> wrote:
>
>> +When requesting conversion to text format, the actual data is what has
>> +been printed on stdout (-noout -text), not the content of the empty
>> +file.
>> +
>> +--- lib/OpenSSL.pm.orig     Tue Jul 25 22:12:00 2006
>> ++++ lib/OpenSSL.pm  Sat Feb 21 19:13:26 2015
>> +@@ -869,6 +869,10 @@ sub convdata {
>> + 
>> +    unlink($file);
>> + 
>> ++   if($opts->{'outform'} eq 'TEXT') {
>> ++       $tmp = $ext;
>> ++   };
>> ++
>> +    return($ret, $tmp, $ext);
>> + }
>> + 
>
> Hmm.  The value of $ext is this:
>
>    $ext = "$cmd\n\n";   # ???
>    while(<$rdfh>){
>       $ext .= $_;
>    };

I didn't expect this to be a problem but I admit that I did not check
closely.

Here's an updated diff:

Index: Makefile
===================================================================
RCS file: /cvs/ports/security/tinyca/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- Makefile    27 Aug 2014 06:58:00 -0000      1.11
+++ Makefile    21 Feb 2015 17:55:38 -0000
@@ -3,7 +3,7 @@
 COMMENT=       GUI to manage a certification authority
 
 DISTNAME=      tinyca2-0.7.5
-REVISION=      3
+REVISION=      4
 CATEGORIES=    security
 
 HOMEPAGE=      http://tinyca.sm-zone.net/
Index: patches/patch-lib_CA_pm
===================================================================
RCS file: patches/patch-lib_CA_pm
diff -N patches/patch-lib_CA_pm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_CA_pm     21 Feb 2015 17:40:50 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- lib/CA.pm.orig     Sat Feb 21 18:36:47 2015
++++ lib/CA.pm  Sat Feb 21 18:37:21 2015
+@@ -1392,7 +1392,7 @@ sub _rm_dir {
+          unlink($dir."/".$f);
+       }
+    }
+-   closedir(DIR);
++   closedir($dirh);
+ 
+    rmdir($dir);
+    
Index: patches/patch-lib_OpenSSL_pm
===================================================================
RCS file: patches/patch-lib_OpenSSL_pm
diff -N patches/patch-lib_OpenSSL_pm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_OpenSSL_pm        26 Feb 2015 17:31:03 -0000
@@ -0,0 +1,42 @@
+$OpenBSD$
+
+When requesting conversion to text format, the actual data is what has
+been printed on stdout (-noout -text), not the content of the empty
+file.
+
+--- lib/OpenSSL.pm.orig        Tue Jul 25 22:12:00 2006
++++ lib/OpenSSL.pm     Thu Feb 26 18:30:58 2015
+@@ -817,7 +817,7 @@ sub convdata {
+    my $self = shift;
+    my $opts = { @_ };
+    
+-   my ($tmp, $ext, $ret, $file, $pid, $cmd);
++   my ($tmp, $ext, $ret, $file, $pid, $cmd, $output);
+    $file = HELPERS::mktmp($self->{'tmp'}."/data");
+ 
+    $cmd = "$self->{'bin'} $opts->{'cmd'}";
+@@ -834,10 +834,12 @@ sub convdata {
+    $ext = "$cmd\n\n";
+    $pid = open3($wtfh, $rdfh, $rdfh, $cmd);
+    print $wtfh "$opts->{'data'}\n";
++   $output = '';
+    while(<$rdfh>){
+-      $ext .= $_;
++      $output .= $_;
+       # print STDERR "DEBUG: cmd ret: $_";
+    };
++   $ext .= $output;
+    waitpid($pid, 0);
+    $ret = $?>>8;
+ 
+@@ -868,6 +870,10 @@ sub convdata {
+    close(IN);
+ 
+    unlink($file);
++
++   if($opts->{'outform'} eq 'TEXT') {
++       $tmp = $output;
++   };
+ 
+    return($ret, $tmp, $ext);
+ }


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to