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

Refactor get_socket_path() and support KPXC 2.7.4 for Flatpak #55

Merged
merged 2 commits into from
Oct 31, 2022

Conversation

Frederick888
Copy link
Owner

@Frederick888 Frederick888 commented Oct 31, 2022

Description

Fixes #53

Changes

4436b22 refactor: Separate socket path logic for OSes/KPXC versions

Breaks down the very convoluted get_socket_path() into smaller pieces,
each taking care of a specific OS and KeePassXC (or KeePass 2)
combination.

Also instead of using a OnceCell to cater for the command line argument,
pass it along using an environment variable. There is no need to cache
this result anyway since it's only called by get_stream(). This should
fall into place nicely in terms of their priority as well.

7356fc8 feat: Support socket path of KPXC 2.7.4 Flatpak

To avoiding mounting everything into Flatpak sandbox, the socket was
moved into a separate path under Linux [1][2].

Note this does not affect other distributions under Linux as there is a
symbolic link from the old path [3].

[1] keepassxreboot/keepassxc#8030
[2] keepassxreboot/keepassxc@1009650
[3] https://github.com/keepassxreboot/keepassxc/blob/2.7.4/src/browser/BrowserShared.cpp#L49

Checklist

  • I have rebased my branch so that it has no conflicts
  • I have added tests where appropriate
  • Commit messages are compliant with Conventional Commits

Is this a breaking change?

No

@Frederick888 Frederick888 marked this pull request as ready for review October 31, 2022 11:25
Breaks down the very convoluted get_socket_path() into smaller pieces,
each taking care of a specific OS and KeePassXC (or KeePass 2)
combination.

Also instead of using a OnceCell to cater for the command line argument,
pass it along using an environment variable. There is no need to cache
this result anyway since it's only called by get_stream(). This should
fall into place nicely in terms of their priority as well.
To avoiding mounting everything into Flatpak sandbox, the socket was
moved into a separate path under Linux [1][2].

Note this does not affect other distributions under Linux as there is a
symbolic link from the old path [3].

[1] keepassxreboot/keepassxc#8030
[2] keepassxreboot/keepassxc@1009650
[3] https://github.com/keepassxreboot/keepassxc/blob/2.7.4/src/browser/BrowserShared.cpp#L49
@Frederick888 Frederick888 merged commit 9bfc775 into master Oct 31, 2022
@Frederick888 Frederick888 deleted the refactor-socket-path branch October 31, 2022 14:37
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.

KeePassXC update 2.7.2/2.7.3 breaks connection to Unix socket
1 participant