Hello folks,
I am using open3 to create a commumnication channell to gnupg. I am
writing a web based interface for encrypting and decrypting files. I am
having a lot of trouble with decrypting messages. Here is a piece of
code form my programme:
# This is actual code in perl
$cmd = "--homedir $home --decrypt $encryptFile";
# Execute user defined routine
# open3($fin, $fout, $ferr,"$self->{GPGExec} $cmd") || return
EXEC_ERROR();
my $result = $self->Execute($cmd,FIN,FOUT,FERR);
# this passes in the passphrase
print FIN "$passPhrase\n";
# this closes the communication channel,
# indicating we are done
close FIN;
my @error_output = <FERR>; # reading the error
my @plaintext = <FOUT>; # reading the output
# clean up...
close FOUT;
close FERR;
And here is my Execute routine:
sub Execute
{
my ($self,$commands,$in, $out, $err) = @_;
my ( $fin,
$fout,
$ferr,
);
# Put the file descriptors in the callers package
$fin = (caller)[0] . "::$in";
$fout = (caller)[0] . "::$out";
$ferr = (caller)[0] . "::$err";
my $result = undef;
my $cmd = shift(@$commands);
Debug ("secureDB::GPG::Exec=$self->{GPGExec} $cmd");
$ENV{GNUPGHOME} = $self->{GNUPGHOME} ||
GNUPGHOME;
my $pid = open3($fin, $fout,
$ferr,"$self->{GPGExec} $cmd") || return EXEC_ERROR();
}
Can any one help me debug this thing?
I appreciate all the help that I can get. I am using perl 5.053 with
mod_perl version mod_perl/1.24_01
Thanks in advance
-r
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]