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

keepass kdbx files change not detected #11

Open
Vagrantin opened this issue Feb 25, 2018 · 2 comments
Open

keepass kdbx files change not detected #11

Vagrantin opened this issue Feb 25, 2018 · 2 comments

Comments

@Vagrantin
Copy link

Debian 9.3
Spotter 0.2
pyinotify-0.9.6
python --version 2.7.13
python3 --version 3.5.3

I'm using spotter to monitor modification on my keepass deb, but strangly enough modifications on this file are not raised by spotter, here is how I repro the issue.
The step below done with a .txt file does work ok

  1. create your .kdbx file
  2. create your .spotter to monitor your file with this directive,
    watch: *.kdbx -> echo "ok ca marche"
  3. Start spotter (spotter &)
  4. Make any change using any keepass app
  5. The command is never triggered…

Also the only way I manage to the command trigger was doing this

  1. create your .kdbx file
  2. create your .spotter to monitor your file with this directive,
    watch: *.kdbx -> echo "ok ca marche"
  3. Start spotter (spotter &)
  4. cp my.kdbx temp.kdbx
  5. The echo command is properly trigger
  6. echo toto > temp.kdbx
  7. The echo command is properly trigger

Any though why this is happening ?

Thanks for any input.
Matth

@borntyping
Copy link
Owner

I've seen some similar problems before, where some applications use complex methods to save files in place resulting in them not triggering the inotify flags spotter listens for.

Currently it listens for pyinotify.IN_CREATE | pyinotify.IN_CLOSE_WRITE. If you want to have a go at debugging this, I'd start with modifying INOTIFY_EVENT_MASK in spotter/spotter.py to try and catch more events, printing the entire event in process_default(), and using that to see what Keepass is doing when it saves the file.

@Vagrantin
Copy link
Author

Vagrantin commented Feb 27, 2018

Effectively,I have done some test with pyinotify and I'm getting pyinotify.IN_DELETE_SELF because the soft is basically deleting the previous version of the file and pushing a new one.

With a bit more details when saving the db the masks are in this order:

IN_OPEN
IN_CLOSE_NOWRITE
IN_ATTRIB
IN_DELETE_SELF
IN_IGNORED

So I guess this won't do the trick for my case since spotter doesn't listen any of those masks, probably because this is an encrypted db, the files doesn't get modified be regenerated each time I hit the save button.

Matth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants