asbru-cm / asbru-cm

Ásbrú Connection Manager is a user interface that helps organizing remote terminal sessions and automating repetitive tasks.

Home Page:https://www.asbru-cm.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for KeepassXC 2.7.0 (and above)

xattack opened this issue · comments

Describe the bug
A clear and concise description of what the bug is.

After getting an update for KeepassXC , it appears that asbru cannot get the
passwords from KeepassXC in new connections

To Reproduce
Steps to reproduce the behavior:

  1. Create a new connection
  2. try to assign the proper credentials
  3. It hangs

Expected behavior
A clear and concise description of what you expected to happen.

Getting the operations done

Screenshots
If applicable, add screenshots to help explain your problem.

Asbru cannot complete the operations , even search for already know credentials

asbru-issue

In the console , this is what I get

asbru-console-messages

The new version of KeepassXC

keepassXC-2 7 0

I tried to assign manually the chains that it gets when it works, in the username space <username|/root group/sub group/name definition> and in password <password|/root group/sub group/name definition>, and it didn't work

asbru-test

Screenshot from 2022-03-24 11-12-38

Environment (please complete the following information):

  • OS: Linux Mint 19.3 Tricia
  • Ásbrú Version 6.3.3

Additional context
Add any other context about the problem here.

Hi ...
I'm unable to search credentials when using Keepassxc 2.7.1 on CentOS 8 Stream and RHEL 8.5.
I could not find any exceptions/errors.
May you please have a look into this @gfrenoy ?
Thanks a lot.

It looks like the locate command has been replaced by search.... We'll need to check the version and change the code accordingly.

In the meantime, a quick fix would be to replace the keyword in _locateEntries (file lib/PACKeePass.pm)...

Edit: see keepassxreboot/keepassxc@e8f2c9d

Just pushed a fix for both the master and loki branches. Let me know if it works for you.

Thanks @gfrenoy ...
Nope it doesn't work ... yet.
I notice a short CPU hog when I type in the search box ... but still no results are shown.

Strange, the search now works fine here. Connections using KP are also working correctly.

Is this working fine from the command line:

keepassxc-cli search '<your-kdbx-file>' '/'

To make sure the command is correctly prepared, you can also display it? Add some print in PACKeePass.pm...

Hi ...

Here are the commandl line test results:

[mockbuild@testc8]$ keepassxc-cli search 'Test.kdbx' '/'
Enter password to unlock Test.kdbx: 
No results for that search term.

[mockbuild@testc8]$ keepassxc-cli search 'Test.kdbx' 'rasp'
Enter password to unlock Test.kdbx: 
/Test/raspserver

And this is using the Asbru GUI:

image

image

I added one print in the sub _locateEntries function and it always print something like this no matter how many keys I press ,,,

keepassxc-cli search '/home/mockbuild/Test.kdbx' '/'

I guess I added it in the wrong place ... How to debug this further ?

I added one in the sub _locateEntries function and it always print something like this no matter how many keys I press ,,,

Yes, that is expected.

keepassxc-cli search '/home/mockbuild/Test.kdbx' '/'

What is not expected is that this does not match any entry in your file ?!? It is supposed to match all entries...

I guess I added it in the wrong place ...

No this is OK :) Ásbrú is reading all the entries and doing the filtering in memory.

I think I get it ... We should have an "empty" term instead of '/'... As it is now, it will only match entries into subfolders but not the root entries.

Need to leave the keyboad now but I'll push another fix in a couple of hours.

In the meantime, you should remove the slash on this line:

$pid = open2(*Reader,*Writer,"$CLI $$self{kpxc_cli} ${search_command} $$self{kpxc_keyfile_opt} '$$cfg{database}' '/'");

So the line should be:

$pid = open2(*Reader,*Writer,"$CLI $$self{kpxc_cli} ${search_command} $$self{kpxc_keyfile_opt} '$$cfg{database}' ''");

That makes sense as per the command line test executed previously.
The '/' argument worked fine with KeePassXC versions below 2.7.0. Maybe that changed as well..
Meanwhile tested this code in the sub _locateEntries function and it works fine:


            if (version->parse($$self{kpxc_version}) >= version->parse("2.7.0")) {
                $pid = open2(*Reader,*Writer,"$CLI $$self{kpxc_cli} ${search_command} $$self{kpxc_keyfile_opt} '$$cfg{database}' ''");
            } else {
                $pid = open2(*Reader,*Writer,"$CLI $$self{kpxc_cli} ${search_command} $$self{kpxc_keyfile_opt} '$$cfg{database}' '/'");
            }

Thanks for the check, I made the change and it has been pushed to master & loki so it should be in the snapshots and loki repository in 20 minutes.

Still not working ...
Re-added the print instruction and now nothing is printed into the terminal.
I noticed you added the search_term variable to the KeePassXC version test and are using it ithe the open2 call, but something is wrong (not sure what ... I do have to learn Pear).
By replacing it with the code in my previous update is works.

Ouch! Sorry, looks like I'm tired today ... I made a typo :-/ Should now be fixed... Thanks for your patience!

This code works:
$pid = open2(*Reader,*Writer,"$CLI $$self{kpxc_cli} ${search_command} $$self{kpxc_keyfile_opt} '$$cfg{database}' '${search_term}'");

The latest Loki build (asbru-cm-6.4.0~1649531693-1.el8) works fine!
Thanks a lot @gfrenoy !