-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Database Custom Data Merging #3002
Support Database Custom Data Merging #3002
Conversation
94c623d
to
542300a
Compare
542300a
to
3c97951
Compare
3c97951
to
a2ea7af
Compare
I'd like to get this into 2.4.2 |
01ecb77
to
dcb18b1
Compare
I know the tests still fail. This is because CustomData now has an extra size. And the returned size cannot be changed in a way the _LAST_MODIFIED should stay hidden. If returned size/dataSize is modified to hide _LAST_MODIFIED, tests will fail when the KDBX format is upgraded to version 4. |
It would be inappropriate to "hide" the last modified entry. The tests need to be adjusted. |
@droidmonkey That's what I'm doing now. For example TestKdbx4.cpp:189 still fails. |
I'll look at it when I can |
I wonder if this happens because KdbxXmlReader (and other classes) uses CustomData::set() when parsing items and now it updates the _LAST_MODIFIED every time (KdbxXmlReader.cpp:438 for example). |
The alternative would be to use the timestamp as a suffix of the key and parse it out before displaying the key. But that may be a bit ugly if viewed with anything but KeePassXC. |
Yah that would also break plugins in other programs that were unaware of the suffix. |
The format clearly restricts the possibilities here. |
The proper way would be an XML attribute or another element (I don't like this element-centric style, but KDBX uses it everywhere). We need to keep that in the list for KDBX5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update the other tests that check the custom data size to pass.
TestKdbx4.cpp:189 is the only thing failing, but I haven't found a reason why it happens. The content is identical. |
It's failing because the number of custom data elements is 1 higher then expected since the _LAST_MODIFIED key is added. |
@droidmonkey That's not the case in that comparison. The number of custom data elements is identical. I already changed the sizes. Should comment them though that the +1 is because of _LAST_MODIFIED. |
f9cde0f
to
0543683
Compare
- Improve resilience against memory attacks - overwrite memory before free [#3020] - Prevent infinite save loop when location is unavailable [#3026] - Attempt to fix quitting application when shutdown or logout issued [#3199] - Support merging database custom data [#3002] - Fix opening URL's with non-http schemes [#3153] - Fix data loss due to not reading all database attachments if duplicates exist [#3180] - Fix entry context menu disabling when using keyboard navigation [#3199] - Fix behaviors when canceling an entry edit [#3199] - Fix processing of tray icon click and doubleclick [#3112] - Update group in preview widget when focused [#3199] - Prefer DuckDuckGo service over direct icon download (increases resolution) [#2996] - Remove apply button in application settings [#3019] - Use winqtdeploy on Windows to correct deployment issues [#3025] - Don't mark entry edit as modified when attribute selection changes [#3041] - Use console code page CP_UTF8 on Windows if supported [#3050] - Snap: Fix locking database with session lock [#3046] - Snap: Fix theming across Linux distributions [#3057] - Snap: Use SNAP_USER_COMMON and SNAP_USER_DATA directories [#3131] - KeeShare: Automatically enable WITH_XC_KEESHARE_SECURE if quazip is found [#3088] - macOS: Fix toolbar text when in dark mode [#2998] - macOS: Lock database on switching user [#3097] - macOS: Fix global Auto-Type when the database is locked [#3138] - Browser: Close popups when database is locked [#3093] - Browser: Add tests [#3016] - Browser: Don't create default group if custom group is enabled [#3127]
Type of change
Description and Context
Merges the custom data from database metadata.
We store an extra key _LAST_MODIFIED (UTC Date/Time) and make comparisons based on that value. Lacking this key we assume the source DB is "newer".
If Source is Newer:
If Source is Older:
Fixes #2991.
Testing strategy
Test cases are made.
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]