keepassxc-cli show: resolve references in output#1280
keepassxc-cli show: resolve references in output#1280louib merged 4 commits intokeepassxreboot:developfrom cyphar:keepasscli-resolve-references
Conversation
|
Just a note. keepassxc/src/gui/DatabaseWidget.cpp Line 554 in fb6636d |
|
Ah, I didn't know you could use references for Notes (though I guess that makes sense, since references are used everywhere). As an aside, I have a proposal that we should be applying |
|
Is this working for you? The fix seems correct but from an up-to-date When tracing, |
|
@cyphar I agree, but we need to make a deep refactor of the code |
|
@chuinul I've seen this as well. I've figured it out and will push a fix for this problem and add some tests (the bug was that |
|
Yup, it's already tracked as #1269 |
|
Alright, I've done quite a few fixes in this PR now.
Tests all pass, and I've verified that things work now. |
TheZ3ro
left a comment
There was a problem hiding this comment.
Nice work. 👍 for testing
tests/TestEntry.cpp
Outdated
| Database db; | ||
| Group* root = db.rootGroup(); | ||
|
|
||
| Entry *original = new Entry(); |
There was a problem hiding this comment.
@cyphar we normally place pointers on the left, just like Group* root above.
4c4d8a5 ("Implement search for reference placeholder based on fields other than ID") changed the semantics of searching-by-reference in KeePassXC. Unforuntately it contained a bug where it implicitly became case-sensitive to UUIDs, which broke existing databases that used references (especially since the default reference format uses a different case to the UUID used while searching). The tests didn't catch this because ->toHex() preserves the case that it was provided, they have been updated to check that UUIDs are case insensitive. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Previously, `keepassxc-cli show` would not resolve references. This would make it quite hard to script around its output (since there's not interface to resolve references manually either). Fix this by using resolveMultiplePlaceholders as with all other users of ->password() and related entry fields. Fixes: #1260 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
The access control dialog previously would not show the "real" username or "real" title when asking for permission to give access to entries. Fix this by resolving it, as we do in many other places. Fixes: #1269 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This ensures that the most "intuitive" current usage of references (through the clone feature of the GUI) remains self-consistent and always produces the correct results. In addition, explicitly test that case insensitivity works as expected. These should avoid similar regressions in reference handling in the future. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
|
Rebased on #1289 since it's been merged. |
Previously,
keepassxc-cli showwould not resolve references. Thiswould make it quite hard to script around its output (since there's not
interface to resolve references manually either). Fix this by using
resolveMultiplePlaceholders as with all other users of ->password() and
related entry fields.
Fixes #1260
Fixes #1269
Fixes #1211
Signed-off-by: Aleksa Sarai cyphar@cyphar.com
How has this been tested?
I tested this on my own KeePassXC database on several different entries (included nested ones), and verified that entries which were references now resolved to the correct value and that non-reference values also are correctly handled.
Types of changes
Checklist:
-DWITH_ASAN=ON. [REQUIRED]LeakSanitisergives errors ondevelopat the moment, but as far as I can tell no additionalASANerrors were added by this change.