Skip to content

keepassxc only relies on inotify to handle external changes #1799

@tatankat

Description

@tatankat

Expected Behavior

If the password database file is on a shared filesystem (for example webdav, sshfs or nfs), the file should be regularly checked for changes, as inotify does not work on these filesystems with changes by other clients.

Current Behavior

If another program changes the password database, it is only detected if the filesystem is supported by inotify. So if the file is on a webdav, sshfs, nfs or other network filesystem, the changes are not detected. When another client changes and saves the database and (for example) several hours later, we change and save the database, the changes by the other client are lost.

Also, if another client changes and saves the password database, the only way to use the changes is to close and re-open the file.

Possible Solution

"Regular checking" should be done before saving (to prevent overwriting changes by other clients) and can be done on focus gain and several other actions done on the database.
If the file has changed, then it can be handled just like when a change was detected by the QFileSystemWatcher.
If keepassxc should do the regular checking, can be defined by a setting, because it is probably not possible to detect reliably if the file is on a shared filesystem.

Steps to Reproduce (for bugs)

  1. open the password database file from another computer using sshfs
  2. change and save the file on the other computer
  3. change and save the file on the computer where you mounted the directory with sshfs
  4. changes done in 2. are lost without notice

Context

We share the same password database files over nfs (and sshfs) as this is our default filesystem to share files between several users.
It is useful to always have the latest version available, but now we only have the latest version after closing and re-opening. On top of that, it is a dangerous situation to loose changes.

Debug Info

KeePassXC - 2.3.1

Operating system: Linux
CPU architecture: x64
Kernel: 4.4.120

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions