removed locking in NOTEDB::pwsafe3::_retrieve() which was senseless.

This commit is contained in:
git@daemon.de
2012-11-28 15:11:52 +01:00
parent afe46a308a
commit bc776e88bf
5 changed files with 8 additions and 10 deletions

View File

@@ -1,4 +1,8 @@
1.3.14: 1.3.14:
fixed bug in NOTEDB::pwsafe3 backend, it used lockging on the
database file for reading, which is wrong.
================================================================================
1.3.13:
ADDED: new config parameter 'motd', a note entry which will be shown ADDED: new config parameter 'motd', a note entry which will be shown
on startup (if exists). on startup (if exists).
CHANGED: the prompt will now show if the current instance is running CHANGED: the prompt will now show if the current instance is running

View File

@@ -10,7 +10,7 @@ package NOTEDB;
use Exporter (); use Exporter ();
use vars qw(@ISA @EXPORT $crypt_supported); use vars qw(@ISA @EXPORT $crypt_supported);
$NOTEDB::VERSION = "1.35"; $NOTEDB::VERSION = "1.36";
BEGIN { BEGIN {
# make sure, it works, otherwise encryption # make sure, it works, otherwise encryption

View File

@@ -3,7 +3,7 @@
package NOTEDB::pwsafe3; package NOTEDB::pwsafe3;
$NOTEDB::pwsafe3::VERSION = "1.01"; $NOTEDB::pwsafe3::VERSION = "1.02";
use strict; use strict;
use Data::Dumper; use Data::Dumper;
@@ -310,9 +310,6 @@ sub _retrieve {
my $file = $this->{dbname}; my $file = $this->{dbname};
if (-s $file) { if (-s $file) {
if ($this->filechanged() || $this->{unread}) { if ($this->filechanged() || $this->{unread}) {
my $fh = new FileHandle "<$this->{dbname}" or die "could not open $this->{dbname}\n";
flock $fh, LOCK_EX;
my %data; my %data;
if (! $key) { if (! $key) {
$key = $this->_getpass(); $key = $this->_getpass();
@@ -341,9 +338,6 @@ sub _retrieve {
exit 1; exit 1;
} }
flock $fh, LOCK_UN;
$fh->close();
$this->{unread} = 0; $this->{unread} = 0;
$this->{data} = \%data; $this->{data} = \%data;
return %data; return %data;

View File

@@ -144,7 +144,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc");
$USER = getlogin || getpwuid($<); $USER = getlogin || getpwuid($<);
chomp $USER; chomp $USER;
$TOPIC = 1; $TOPIC = 1;
$version = "1.3.13"; $version = "1.3.14";
$CurDepth = 1; # the current depth inside the topic "directory" structure... $CurDepth = 1; # the current depth inside the topic "directory" structure...
$maxlen = "auto"; $maxlen = "auto";
$timelen = 22; $timelen = 22;

View File

@@ -535,6 +535,6 @@ Thomas Linden <tom at linden dot at>
=head1 VERSION =head1 VERSION
1.3.13 (14/11/2012) 1.3.14 (28/11/2012)
=cut =cut