Subject: | Can't call method "type" on unblessed reference at /usr/local/share/perl5/Crypt/PWSafe3.pm line 390. |
Date: | Sun, 19 Feb 2012 21:43:07 -0800 |
To: | bug-Crypt-PWSafe3 [...] rt.cpan.org |
From: | Luca Filipozzi <luca.filipozzi [...] gmail.com> |
Hi,
I really appreciate your package, Crypt::PWSafe3. I'm using it to
make a command-line enterprise password manager. I'm really pleased
with how thorough of an interface to pwsafe3 files you've created.
That said, I've encountered one bug. Here's the relevant snippet from
my code (best viewed in fixed width font):
my $uuid = $ARGV[0];
my $record = $pwsafe->getrecord($uuid) or print "no such
record '$uuid'\n" and return;
print 'group: ' . $record->group . "\n" if $record->group;
print 'title: ' . $record->title . "\n" if $record->title;
print 'username: ' . $record->user . "\n" if $record->user;
print 'password: ' . $record->passwd . "\n" if $record->passwd;
print 'notes: ' . $record->notes . "\n" if
$record->notes; ### BUG IS HERE
$record->atime(time);
$pwsafe->addrecord($record);
$pwsafe->markmodified();
$pwsafe->save(); ### AND CAUSES PROBLEM HERE
If I call $record->notes, then the $pwsafe->save() dies with the error
in the subject line.
If I comment out the line where $record->notes is called, then save() succeeds.
This only happens on records where the notes field is empty.
I've created records in the vault using both Crypt::PWSafe3 and Java
PasswordSafe. When the notes field is populated, everything works
correctly. When the notes field is empty, the unblessed reference
error is generated even if only the existence of the notes is checked.
I hope that this bug report proves useful. Let me know if you would
like more information.
Thanks for your great work,
Luca
--
Luca Filipozzi