Skip to content
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

KeeShare does not detect changes on remote shares #3790

Closed
dssouza-ti opened this issue Nov 4, 2019 · 10 comments · Fixed by #4720
Closed

KeeShare does not detect changes on remote shares #3790

dssouza-ti opened this issue Nov 4, 2019 · 10 comments · Fixed by #4720

Comments

@dssouza-ti
Copy link

dssouza-ti commented Nov 4, 2019

Expected Behavior

When keeshare is enabled on a group, the share file is saved on a samba share and "Automatically reload the database when modified externally" is checked, saving the database with modifications on the shared group should trigger a reload on every database accessing the share.

Current Behavior

Currently this does not happen. The changes are saved on the share, but it does not reload automatically. In order to load the changes and keep saving in the share, I edit the shared group, change the keeshare option to Import, apply the settings, change it back to synchronize and apply the settings again.

Possible Solution

I don't know if this is related to #3506 (if it is, you can mark this issue as duplicate) and I thought it would not happen after #3612, but apart from that, I don't know how to solve this.

Steps to Reproduce

  1. Open a file manager on linux and connect to the samba share typing smb://server/share on the location bar:
    Selection_568

  2. Set up keeshare on a group, saving the file on a samba share (The path here is created automatically by gvfs and its the same every time for the same share):
    Selection_569

  3. Do the same thing on another Linux machine.

  4. In one machine, modify the shared group and save the database.

  5. Verify that the share file was modified (I usually do that by checking the last modified time).

  6. Check the other machine and see that the change was not auto-reloaded.

  7. Edit the shared group, change the keeshare option to import, apply, change back to synchronize and apply again.

  8. See that now the changes were imported correctly.

Context

I have a team that uses the same database on KeePass2 on a samba share utilizing the bidirectional sync option. When trying to move from KeePass2 to KeePassXC, we ran some tests and found this issue.

The main problem for us is not the fact that we have to import manually for it to work, but that if more then one person saves the file before importing, the share file is overwritten and the first changes are lost. Data loss because of not importing before saving is something that does not happens with bidirectional sync, so we can't move from KeePass2 yet.

Debug Info

KeePassXC - Version 2.5.0-snapshot
Build Type: Snapshot
Revision: a8c10cd

KeePassXC - Also tested with stable version 2.5.0 from the Ubuntu PPA and got the same results.

Qt 5.12.4
Debugging mode is disabled.

Operating system: Ubuntu 19.10
CPU architecture: x86_64
Kernel: linux 5.3.0-19-generic

Operating system: Also tested with Ubuntu 18.04 with Kernel 5.0 and got the same results.

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare (signed and unsigned sharing)
  • YubiKey

Cryptographic libraries:
libgcrypt 1.8.4

@droidmonkey
Copy link
Member

This is because the file hash check is only done for the main database. I agree it needs to occur on the keeshare file as well. KeeShare uses the BulkFileWatcher, which I believe they should just use the same FileWatcher class that the main db uses.

@dssouza-ti
Copy link
Author

Is this something trivial to implement? Do you think this could be out in 2.5.1?

@droidmonkey
Copy link
Member

I'm aiming for 2.5.2 at this point

@droidmonkey droidmonkey changed the title Keeshare synchronize option on Linux does not auto-reload changes on a samba share. KeeShare does not detect changes on remote shares Nov 11, 2019
@droidmonkey droidmonkey added this to the v2.5.2 milestone Nov 11, 2019
@jbjhjm
Copy link

jbjhjm commented Nov 12, 2019

We are accessing a database located on a local server available via network with a mix of windows and osx computers. I'm not sure if it is the same bug as I have no idea about samba protocol. But we're experiencing the same behavior, when the database is being updated, KeepassXC running on other devices won't notice.

Edit: Short research on samba/smb, seems windows network drives use smb, too.

@Bruceforce
Copy link

I'm experiencing the same issue even with local paths. So I don't think this is smb / remote related.

@droidmonkey droidmonkey self-assigned this Nov 30, 2019
@droidmonkey droidmonkey modified the milestones: v2.5.2, v2.6.0 Dec 28, 2019
@MountainX
Copy link

MountainX commented Jan 5, 2020

I am experiencing this issue with NFS shares. When one user sets up KeeShare as import and the other user as export, KeeShare works as expected. But when both users set the type to Synchronize, nothing is shared / synchronized in either direction.
I'm using KeePassXC version 2.5.1 on Linux

@Tau512
Copy link

Tau512 commented Jan 7, 2020

I'm aiming for 2.5.2 at this point

still having the same issue in 2.5.2, so i assume you had other priorities. If you did get the issue fixed, then the issue still appears to be present. Initial configuration of keeshare shows all entries in the kdbx.share file, but subsequent entries do not get synced (this is 2x windows10 machines with mapped drive smb share).

@droidmonkey
Copy link
Member

Unfortunately I decided not to touch the KeeShare feature for 2.5.2 since I could have broke it worse then fixing it. This is still on my radar.

@Tau512
Copy link

Tau512 commented Apr 24, 2020

@droidmonkey this appears to be working on the current 2.5.4 release (shared between win10 & Fedora31 with 'syncronize' type).
Since we're intended to use KeeShare feature in a work environment for 4 man team and move away from our KeePass2+plugins method, it'd certainly give us a bit of confidence if you could put your thoughts into KeeShares current state - do you consider it stable now or do you still have work to do in reguard to this bug report?

edit: looks like it might of been my synced kdbx. had keeshare folder in my personal kdbx and appeared to be synced between my kit. doing unique kdbx per-device and keeshare between them all doesnt seem to be syncing (and as per original report). Sorry for any confusion or false hope!

@droidmonkey
Copy link
Member

I have been thinking about it and made many improvements in 2.6 around database file handling. No promises but this might be much easier now.

droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3985, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3985, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3985, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3985, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3985, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3985, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3895, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3895, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
droidmonkey added a commit that referenced this issue May 10, 2020
* Fix #3790, shares now use the standard FileWatcher class to detect remote file changes using checksums and file system triggers.

* Fix #3895, macOS file selection no longer hangs the app.

* Restore saving of KeeShare settings accidentally removed by 596d2cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants