Skip to content

Allow read-only native message files #12236

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

LightAndLight
Copy link

Allow read-only native message files when the on-disk JSON matches the JSON keepassxc wants to write.

I use home-manager to manage my system. I found that it's most reliable when I let home-manager manage ~/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json. Instead of writing the file directly, home-manager creates a symlink to a read-only file in the Nix store. Current versions of keepassxc report an error when they encounter this, because they unconditionally write to that file. This change prevents that error when the read-only file matches what keepassxc would have written (up to formatting differences).

Testing strategy

Manual inspection; recompiled keepassxc and checked that it does what I want.

Type of change

  • ✅ New feature (change that adds functionality)

It's possible[^1] for a native message file to be both correct and read-only.
When current versions of `keepassxc` encounter this, it fails, because
it can't write to the file. In this situation it should only fail if
the read-only file's contents are different to those it's trying to
write.

[^1]: e.g. when using an immutable OS management system like NixOS or
   home-manager.
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

Successfully merging this pull request may close these issues.

1 participant