Bug#412041: libmail-gnupg-perl: encryption methods behave weirdly
if bad recipients are passed
Celejar
celejar at gmail.com
Fri Feb 23 00:56:02 UTC 2007
Package: libmail-gnupg-perl
Version: 0.08-2
Severity: normal
All four of the encryption methods behave strangely and inconsistently
when passed recipients for which gpg can't find public keys. gpg itself
consistently returns: 'gpg: error reading key: public key not found'.
The Mail::GnuPG encryption methods sometimes behave correctly, returning a
non-zero status code, with $self->{last_message} containing:
gpg: recipient: skipped: public key not found
gpg: [stdin]: encryption failed: public key not found
where 'recipient' is the unmatched recipient.
But sometimes, the program just dies without any explanation, dropping
unceremoniously to a command prompt. This occurs even when running under
rhe debugger; the debugger itself just terminates with no explanation.
The following simple program exhibits the aforementioned behavior:
---Begin Program---
#! /usr/bin/perl -w
use strict;
use MIME::Parser;
use Mail::GnuPG;
my $msg = MIME::Entity->build(Subject => 'Test', From => 'a at b.c', To => 'd at e.f', Data => "Some text.\nSome more text.\n");
my $mg = new Mail::GnuPG;
my $status = $mg->mime_encrypt($msg, 'd at e.f');
!$status or die "@{$mg->{last_message}}\n";
print "Message successfully encrypted.\n";
---End Program---
When I run this repeatedly in succession, sometimes I get the above
'gpg: ...' error lines, and sometimes the program just terminates with
no output. The 'print' line is never reached.
I'm just a perl newbie, but this behavior can't be right; surely the
methods should consistently return an error code and not just silently
terminate.
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-lizzie
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages libmail-gnupg-perl depends on:
ii libgnupg-interface-perl 0.33-6 Perl interface to GnuPG
ii libmailtools-perl 1.74-1 Manipulate email in perl programs
ii libmime-perl 5.420-1 Perl5 modules for MIME-compliant m
ii perl 5.8.8-7 Larry Wall's Practical Extraction
libmail-gnupg-perl recommends no packages.
-- no debconf information
More information about the pkg-perl-maintainers
mailing list