-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Database does not lock if it has unsaved changes #721
Comments
Yep. Making it always lock is an easy fix, but maybe the |
Additionally it doesn't lock if you have unsaved changes. I don't know how that should be handled. Save to a temporary file and lock both databases? Does it need its own issue or can it be discarded as intended behavior? |
We can avoid this by disabling setting "lock databases" settings if "autosave db" is not enable. |
I agree with that. Here's the original reason for not locking when a modal is open (from commit 721bec9):
@keepassxreboot/core-developers what do you think? I don't know how easy that fix would be. |
I think it's the right thing to do. Maybe using a flag to prevent locking, setting the flag to true when a dangerous action is being made. |
I'm available for this task!
On 12 Sep 2017 1:22 pm, "TheZ3ro" <notifications@github.com> wrote:
MainWindow::lockDatabasesAfterInactivity() could prevent locking for the
cases deemed dangerous, but proceed with locking for the other cases
(including the about window, for example).
I think it's the right thing to do. Maybe using a flag to prevent locking,
setting the flag to true when a dangerous action is being made.
Can someone look into this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#721 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMqpZPKVGmFg7S6R8IQAWR6U73xGVOEPks5shmmCgaJpZM4OJ1uD>
.
|
I am moving this to 2.3.0 because it may require refactoring how saving and other settings are handled. |
Is this fixed in v2.3.0? Or will it be tackled in #1234 ? |
It's not fixed and #1234 won't fix it |
Thanks, I was confused because the milestone still says 2.3.0. |
v2.3.0 is still in development (ie not released) |
Sorry, my bad. I read the release 2.2.4 as 2.4.2. |
I had locked the desktop by Win+L, but when came back there was the following window. It was expected the database would have been mandatory saved then locked (disclosure: longtime Keepass user). There are internal history and recycle bin along with external backups to roll back if something wrong happens. I am glad this was caught with the test database, outside the production environment. Perhaps we should create a Pitfalls section on the front page to warn about “known but so far unresolved sensitive issues”? |
(continuing from #6593)
Wouldn't this comment be the general solution that should be applied to all dialogs except the few dangerous cases that were outlined in this earlier comment? Rather than chasing this bug one dialog at a time, identify which specific cases are dangerous, and then apply the general solution everywhere else. |
Actually, I'd even argue that the middle option of the proposed solution (save to temporary file, then merge) is still safe even for the two cases already identified as dangerous:
In both cases, the changes are saved to a temporary file, and both DBs are locked. Thus, both the changes and the original DB are safely preserved, and the process can be resumed when appropriate. So I propose the following extended solution:
Anyway, the MVP is still just to add that setting and apply the selected action to all safe dialogs. The above extra handling of the dangerous dialogs can be implemented separately. |
Not sure if this is the right place but as all the other lock issues got linked here and closed elsewhere, I'd like to add my lock issue here too: I'm on Ubuntu 20 and always keep KeePassXC in the background, but no other dialog is open and no changes have been made. When locking the desktop and coming back later, the database of KeePassXC is locked too, as expected. But it seems, that only works for a period of time (locking once per day for a couple of days) and then suddenly doesn't work anymore. As if a service or system status wasn't functioning properly after a while. I know, this is such a vague issue description, that it's impossible to help based on this. I'd be happy to dig into the logs, if I only knew what I should be looking for. Anyone with an idea, what component could possibly influence that behavior for that matter? |
Locking keepassxc when the computer locks depends on a dbus signal that is sent out by your screen lock program. No signal, no lock. Check that dbus signal is being emitted every time your desktop locks. |
There is this signal when locking:
and that one when coming back:
What's interesting: having a radio stream on, that gets properly interrupted when locking this way, but KeePassXC doesn't. |
Yah that isn't going to cut it, here is the code which is very readable that shows the signals listened for. This is decidedly another issue then this one but had also come up before. |
As lock issues have been linked and discussed here, I'm commenting here. #9992: The situation got worse due to the change of what is triggering the save button to be enabled (related to #9697?). Compared to version 2.7.0 (tested with KeePassXC-2.7.0-x86_64.AppImage), version 2.7.6 (deb installation) now enables the save button also when changes occur to the state of the group tree, i.e. by opening or closing a group. In my case, choosing an entry or even opening it is not enabling the save button as long as I don't change any data. Beside the other aspects already brought up in this thread, it seems necessary to decide:
|
* Fix keepassxreboot#6593 - force close any modal dialogs associated with a database widget that is being locked. * Partial fix for keepassxreboot#721 but doesn't address the problem of needing to save a modified entry or database while locking. * Also improves import dialog behavior if databases(s) lock while it is visible.
Expected Behavior
When the setting "lock databases when session is locked or lid is closed" is enabled, the database should be locked on sleep even if the about menu is showing
Current Behavior
Database remains unlocked with about menu active
Possible Solution
Steps to Reproduce (for bugs)
Context
Debug Info
KeePassXC - Version 2.2.0
Revision: caa49a8
Libraries:
Operating system: macOS Sierra (10.12)
CPU architecture: x86_64
Kernel: darwin 16.6.0
Enabled extensions:
The text was updated successfully, but these errors were encountered: