Skip Menu |

This queue is for tickets about the Mail-GnuPG CPAN distribution.

Report information
The Basics
Id: 21349
Status: new
Priority: 0/
Queue: Mail-GnuPG

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.08
Fixed in: (no value)



Subject: doesn't work with mod_perl2
Hi, this is strictly speaking a problem in Apache mod_perl2, but as it seems very easy to work around it in Mail::GnuPG, I'm submitting it here. Mail::GnuPG::verify uses GnuPG::Interface in a way that doesn't work with mod_perl2. The problem is that GnuPG::Interface::verify is called without a separate handle for stdout. In my understanding, GnuPG::Interface then uses the real stdout for this and wants to call fileno() on it (in fork_attach_exec() around line 228 of GnuPG/Interface.pm, version 0.33) Unfortunately mod_perl2 doesn't support fileno() (it always returns -1) and the result is Can't open(IO::Handle=GLOB(0xd595ec4), >&-1): Invalid argument at /usr/share/perl5/Mail/GnuPG.pm line 425 The attached patch works around the problem by creating a new handle for verify() stdout, in line with the other GnuPG::Interface method calls. Please consider including it. I'm also attaching a crude CGI script that hopefully demonstrates the problem. It works fine as an ordinary CGI program and under mod_perl (ie. version 1) on Apache 1. The problem only occurs with mod_perl2 on Apache2. The system is Debian GNU/Linux unstable, with Perl 5.8.8, GnuPG::Interface 0.33, Mail::GnuPG 0.08, mod_perl 2.0.2. (This originally showed up as a problem with Request Tracker, which can optionally use Mail::GnuPG to verify incoming emails.) Thanks for your work on Mail::GnuPG. Cheers, -- Niko Tyni ntyni@iki.fi
Subject: Mail-GnuPG.patch
--- GnuPG.pm 2006/09/06 12:59:08 1.1 +++ GnuPG.pm 2006/09/06 12:59:23 @@ -394,8 +394,9 @@ $self->_set_options($gnupg); # how we create some handles to interact with GnuPG my $input = IO::Handle->new(); + my $output = IO::Handle->new(); my $error = IO::Handle->new(); - my $handles = GnuPG::Handles->new( stderr => $error, stdin => $input ); + my $handles = GnuPG::Handles->new( stderr => $error, stdout => $output, stdin => $input ); my ($sigfh, $sigfile) = File::Temp::tempfile('mgsXXXXXXXX',
Subject: t.cgi
Download t.cgi
application/x-cgi 880b

Message body not shown because it is not plain text.