From bc776e88bf91021b0fe18e2d9def87dc8a70c164 Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Wed, 28 Nov 2012 15:11:52 +0100 Subject: [PATCH] removed locking in NOTEDB::pwsafe3::_retrieve() which was senseless. --- Changelog | 4 ++++ NOTEDB.pm | 2 +- NOTEDB/pwsafe3.pm | 8 +------- bin/note | 2 +- note.pod | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Changelog b/Changelog index a032073..25a9884 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,8 @@ 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 on startup (if exists). CHANGED: the prompt will now show if the current instance is running diff --git a/NOTEDB.pm b/NOTEDB.pm index 6cc5cdb..61dfe2f 100644 --- a/NOTEDB.pm +++ b/NOTEDB.pm @@ -10,7 +10,7 @@ package NOTEDB; use Exporter (); use vars qw(@ISA @EXPORT $crypt_supported); -$NOTEDB::VERSION = "1.35"; +$NOTEDB::VERSION = "1.36"; BEGIN { # make sure, it works, otherwise encryption diff --git a/NOTEDB/pwsafe3.pm b/NOTEDB/pwsafe3.pm index acb12d9..8f0ec6f 100644 --- a/NOTEDB/pwsafe3.pm +++ b/NOTEDB/pwsafe3.pm @@ -3,7 +3,7 @@ package NOTEDB::pwsafe3; -$NOTEDB::pwsafe3::VERSION = "1.01"; +$NOTEDB::pwsafe3::VERSION = "1.02"; use strict; use Data::Dumper; @@ -310,9 +310,6 @@ sub _retrieve { my $file = $this->{dbname}; if (-s $file) { 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; if (! $key) { $key = $this->_getpass(); @@ -341,9 +338,6 @@ sub _retrieve { exit 1; } - flock $fh, LOCK_UN; - $fh->close(); - $this->{unread} = 0; $this->{data} = \%data; return %data; diff --git a/bin/note b/bin/note index 0270667..945e980 100755 --- a/bin/note +++ b/bin/note @@ -144,7 +144,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc"); $USER = getlogin || getpwuid($<); chomp $USER; $TOPIC = 1; -$version = "1.3.13"; +$version = "1.3.14"; $CurDepth = 1; # the current depth inside the topic "directory" structure... $maxlen = "auto"; $timelen = 22; diff --git a/note.pod b/note.pod index 1ba21f6..d758242 100644 --- a/note.pod +++ b/note.pod @@ -535,6 +535,6 @@ Thomas Linden =head1 VERSION -1.3.13 (14/11/2012) +1.3.14 (28/11/2012) =cut