chazmcgarvey / file-keepass-kdbx Goto Github PK
View Code? Open in Web Editor NEWRead and write KDBX files (using the File::KDBX backend)
Home Page: https://metacpan.org/pod/File::KeePass::KDBX
License: Other
Read and write KDBX files (using the File::KDBX backend)
Home Page: https://metacpan.org/pod/File::KeePass::KDBX
License: Other
I don't fully understand what the problem is, but find_entries() is not being allowed to the set group_id and group_title values in the entries hash, in this code:
sub find_entries {
my ($self, $args, $groups) = @_;
local @{ $args }{'expires gt', 'active'} = ($self->now, undef) if $args->{'active'};
my @tests = $self->finder_tests($args);
my @entries;
foreach my $g ($self->find_groups({}, $groups)) {
foreach my $e (@{ $g->{'entries'} || [] }) {
local $e->{'group_id'} = $g->{'id'};
local $e->{'group_title'} = $g->{'title'};
if (!@tests || !grep{!$_->($e)} @tests) {
push @entries, $e;
push @{ $self->{'__entry_groups'} }, $g if $self->{'__entry_groups'};
}
}
}
return @entries;
}
Specifically, these two lines seem to silently fail:
local $e->{'group_id'} = $g->{'id'};
local $e->{'group_title'} = $g->{'title'};
As a result, calls to find_entries that search by either of those two keys (which kpcli does frequently) fail.
I am still trying to fully understand the issue, but can work around it this way (odd indenting to emphasize the change):
my @entries;
foreach my $g ($self->find_groups({}, $groups)) {
foreach my $e (@{ $g->{'entries'} || [] }) {
my %ee = %{$e};
my $ee = \%ee;
local $ee->{'group_id'} = $g->{'id'};
local $ee->{'group_title'} = $g->{'title'};
if (!@tests || !grep{!$_->($ee)} @tests) {
push @entries, $e;
push @{ $self->{'__entry_groups'} }, $g if $self->{'__entry_groups'};
}
}
}
What really throws me off is that ref($e) shows a simple HASH. My only idea is that maybe File::KDBX made those hashes read only...?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.