I am running Apache 2.0.69 and mp2 mod_perl2-2.0.3_1,3 on FreeBSD 6.1.
I can run a script that decrypts the a PGP encrypted file outside of apache/mp2
and as a CGI script but when run from a perl handler it gives the error
fh is undefined at /usr/local/lib/perl5/site_perl/5.8.8/GnuPG/Interface.pm line
363
GnuPG::Interface::my_fileno('undef') called at
/usr/local/lib/perl5/site_perl/5.8.8/GnuPG/Interface.pm line 240
GnuPG::Interface::fork_attach_exec('GnuPG::Interface=HASH(0x15d5488)',
'handles', 'GnuPG::Handles=HASH(0x10e3948)', 'commands', 'ARRAY(0x18cd158)')
called at /usr/local/lib/perl5/site_perl/5.8.8/GnuPG/Interface.pm line 93
it appears to fail when trying to replace stdin.
I tried using
open(OLDIN, "<&0") || warn "Failed to dup stdin $!";
open(STDIN, "</dev/null") || die "Failed to open stdin as null $!";
to replace stdin with a valid file but the first open fails with
"Failed to dup stdin Invalid argument"
Cheers, Roger