keepass-diff icon indicating copy to clipboard operation
keepass-diff copied to clipboard

Allow diffing files with attachments and history entries

Open Narigo opened this issue 4 years ago • 8 comments

Thanks to report #35 it looks like attachments are currently not handled at all. If an entry diffs because of attached files, keepass-diff will currently say that there is no difference at all. This should not be the case.

Same for history entries.

Tasks

  • [ ] Investigate possibilities how to check attachments with keepass-rs
  • [ ] Investigate possibilities how to check history with keepass-rs
  • [ ] Add a difference to the output if attachments differ from each other (checking the whole binary)
  • [ ] Add a difference if history entries differ from each other (are they compressed binaries as well?)

Use reproducer files from #35 for checking the attachments vs no attachments and create an additional one for changing the current attachment with something else.

Narigo avatar Oct 03 '21 16:10 Narigo

Is this still gonna be fixed? Because diffing without diffing EVERYTHING is essentially quite useless. It would be nice to see this feature in the near future, though I saw that you created an issue on keepass-rs after having problems with the attachments in keepass-rs and it still hasnt been answered. For now it would be nice to at least compare the name and filesize, while it is not a perfect workaround, you could still list all the files with another flag added to the command.

Apart from this problem, this is a great tool and I really hope you keep the work up :)

PaBox avatar Jan 28 '22 14:01 PaBox

Hi @PaBox and thank you for your message!

This tool doesn't really do too much though, it only checks which entries differ from each other. The entries come from the underlying dependency keepass-rs. As long as it doesn't allow opening and checking any information of an attachment, I can't really do anything in this regard.

Please try to reach out to @sseemayer and check whether he's able to contribute to keepass-rs still. He's been very kind and helpful to this project before as he has re-written most of the integration code when he did some breaking changes to his module. It looks like he wasn't very active lately - there are a couple of cool open PRs in keepass-rs by @DavidVentura last year regarding that weren't merged or commented on yet. Maybe he wants to hand over maintenance to someone else...?

Narigo avatar Feb 01 '22 00:02 Narigo

thanks for the ping and the kind words.

You are right in that I have less spare time to spend on maintaining open source code than I had previously, so I would be happy to accept a co-maintainer on the project if that helps in moving progress along.

sseemayer avatar Feb 03 '22 12:02 sseemayer

@sseemayer thanks for the reply! I totally understand the time constraints. Maybe if you look into the pull requests at keepass-rs you can find someone who could help maintaining it? 🙂 It looks like there are people who contribute to it already - maybe someone wants to contribute even more?

Narigo avatar Mar 23 '22 19:03 Narigo

@Narigo For comparing files, I would suggest comparing the file name and the content's checksum, i.e. MD5.

sergiofagostinho avatar Apr 01 '22 13:04 sergiofagostinho

I can give this a shot in my keepass fork -- however I don't feel like my rust skills are good enough to be a maintainer

DavidVentura avatar Apr 01 '22 19:04 DavidVentura

I've looked at this - the biggest thing missing is that the Meta header is not currently stored in the original keepass-rs. When I was trying to implement write support on the DB I got this partially implemented (here), extending this is a fairly small amount of work, but now I remember that this branch had drifted "significantly" from the original

And here is a PR to add that basic parsing of binaries from DB/entry metadata -- the API is very clunky with a string ref to a hashmap in meta

DavidVentura avatar Apr 02 '22 10:04 DavidVentura

@sergiofagostinho yes, that would definitely be a good idea - the problem is that the keepass-rs is currently not supporting attachments at all and hence keepass-diff cannot access information about included files...

@DavidVentura about:

I don't feel like my rust skills are good enough to be a maintainer

I'd say that maintainers need motivation to learn new things and have time to spare. I'd see that as an opportunity to grow 😉

Narigo avatar Apr 02 '22 18:04 Narigo