-
-
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
Fix broken safe saves across file systems #2889
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested using VeraCrypt container. 2.4.0 -> database is deleted and cross-link error thrown |
jankatins
reviewed
Mar 27, 2019
droidmonkey
force-pushed
the
hotfix/unsafe-save-rename
branch
from
March 28, 2019 01:54
a19f894
to
22ce07c
Compare
phoerious
reviewed
Apr 3, 2019
* Fix #2888 * Qt has an undocumented rename implementation for QTemporaryFile that does not fallback to the copy implementation. Forcing the use of QFile::rename(...) allows for this fallback and protects against cross-device link errors.
* Mark database dirty if saving fails * Restore database file from backup if unsafe save fails between deleting database file and copying temporary file into place * Improve error message display for opening and saving database files * Do not automatically retry saving after failure. This prevents deletion of the backup database file and improves user awareness of issues.
droidmonkey
force-pushed
the
hotfix/unsafe-save-rename
branch
from
April 3, 2019 14:23
22ce07c
to
a95e9f2
Compare
Added a lot better handling of failed saving in the latest commit |
phoerious
requested changes
Apr 7, 2019
* Attempt to restore database, if that fails retain the temporary file and tell the user where it is located
droidmonkey
force-pushed
the
hotfix/unsafe-save-rename
branch
from
April 7, 2019 15:51
36fb7c9
to
ab79608
Compare
phoerious
approved these changes
Apr 7, 2019
droidmonkey
added a commit
that referenced
this pull request
Apr 12, 2019
- Fix database deletion when using unsafe saves to a different file system [#2889] - Fix opening databases with legacy key files that contain '/' [#2872] - Fix opening database files from the command line [#2919] - Fix crash when editing master key [#2836] - Fix multiple issues with apply button behavior [#2947] - Fix issues on application startup (tab order, --pw-stdin, etc.) [#2830] - Fix building without WITH_XC_KEESHARE - Fix reference entry coloring on macOS dark mode [#2984] - Hide window when performing entry auto-type on macOS [#2969] - Improve UX of update checker; reduce checks to every 7 days [#2968] - KeeShare improvements [#2946, #2978, #2824] - Re-enable Ctrl+C to copy password from search box [#2947] - Add KeePassXC-Browser integration for Brave browser [#2933] - SSH Agent: Re-Add keys on database unlock [#2982] - SSH Agent: Only remove keys on app exit if they are removed on lock [#2985] - CLI: Add --no-password option [#2708] - CLI: Improve database extraction to XML [#2698] - CLI: Don't call mandb on build [#2774] - CLI: Add debug info [#2714] - Improve support for Snap theming [#2832] - Add support for building on Haiku OS [#2859] - Ctrl+PgDn now goes to the next tab and Ctrl+PgUp to the previous - Fix compiling on GCC 5 / Xenial [#2990] - Add .gitrev output to tarball for third-party builds [#2970] - Add WITH_XC_UPDATECHECK compile flag to toggle the update checker [#2968]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Description and Context
Fix KeepassXC deletes database file after unsafe save on different file system #2888
Qt has an undocumented rename implementation for QTemporaryFile that does not fallback to the copy implementation. Forcing the use of QFile::rename(...) allows for this fallback and protects against cross-device link errors.
Improve behaviors when the database fails to save properly.
This was tested against databases with various extensions and forced failure modes.
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]