mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Back up wallet: appending .bak after Save can overwrite a different file without confirmation #1082
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1082
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Back up wallet can replace an existing backup that was not selected in the Save dialog. The chooser checks the entered filename, but QML appends
.bakafter the dialog accepts it. An existing file at that rewritten destination is then overwritten without a replacement prompt.Steps to reproduce with disposable wallets:
archive.v1.bak.archive.v1in that directory.archive.v1, and click Save.archive.v1; instead,archive.v1.bakis replaced.Restoring the resulting file confirmed that it contained wallet A rather than wallet B. Selecting the existing
archive.v1.bakdirectly did show an overwrite prompt, and declining preserved the original file.The final destination should be resolved before checking whether it exists and asking for overwrite confirmation. Adding a suffix must not bypass that decision.
The path change happens in WalletSectionPage.qml:
resolvedBackupPath()appends the suffix, and the accepted handler passes that rewritten path to the backup operation.Reproduced on
qt6at6e54a48ab571, macOS / Qt 6.9, using the Qt Widgets fallback file chooser in an offscreen run. The native Cocoa chooser was not tested. The demonstrated loss was another wallet’s backup file; the original live wallet remained intact.