Skip to content

Conversation

@f321x
Copy link
Member

@f321x f321x commented Jun 9, 2025

changes the plugins keyfile to either
XDG_CONFIG_HOME/electrum/plugins_key,
or if empty to HOME/.config/electrum/plugins_key
or if HOME is not set either (which should not happen in practice), to /etc/electrum/plugins_key.

Also adds a bring_to_front() call after installing external plugin so the PluginsDialog is raised back in front.

see: https://specifications.freedesktop.org/basedir-spec/latest/
fixes #9922

@f321x f321x force-pushed the change_plugin_keyfile_path branch from 4951e5a to 05ad6bd Compare June 9, 2025 10:38
changes the plugins keyfile to either
XDG_CONFIG_HOME/electrum/plugins_key, or if empty to
HOME/.config/electrum/plugins_key or if HOME is not set either (which
should not happen in practice), to /etc/electrum/plugins_key.

Also adds a `bring_to_front()` call after installing external plugin so
the PluginsDialog is brought back in front.
@f321x f321x force-pushed the change_plugin_keyfile_path branch from 05ad6bd to a436740 Compare June 9, 2025 10:42
Comment on lines +388 to 389
sh_command = f"mkdir -p {base_dir_path} && " + sh_command
commands = ['pkexec', 'sh', '-c', sh_command]
Copy link
Member

@SomberNight SomberNight Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if base_dir_path contains whitespaces or quotes? Previously we used a hardcoded path but now with changing to reading env vars (XDG_CONFIG_HOME and `HOME), anything is game.
See e.g. https://docs.python.org/3/library/shlex.html for escaping stuff.

@ecdsa
Copy link
Member

ecdsa commented Jun 11, 2025

I am not expert enough to tell whether this is safe. It seems to me that the permissions/owner of a file located in a user-owned directory might be less restricted than in a root owned directory.

I think it is safer to postpone this for now. There might be other ways to address #9922

@f321x f321x marked this pull request as draft July 1, 2025 11:25
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.

linux plugin keyfile path may not work on some distros

3 participants