-
Notifications
You must be signed in to change notification settings - Fork 21
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
dbus_init() hangs when called in a script that calls another instance via sudo --preserve-env #22
Comments
It should be noted this works fine without sudo. It fails with sudo without --preserve-env like so:
|
This is a quite exotic configuration… My hypothesis is that:
I'm not sure if this can be fixed at all, but if it can then the fix should be in Jeepney, not in SecretStorage. If I am wrong then pull requests are welcome. |
Just FYI this worked under 2.3.1. I'm not certain the best way to open issues against Jeepney :/ |
I found the jeepney issue board. I'll open one over there as well. This isn't as exotic as you think because this is triggered simply by 'import keyring' |
To summarise the discussions on Jeepney: the hang seen on CentOS 8 is a bug in Jeepney, which I aim to fix by raising the same keyring is meant to gracefully handle errors setting up the backend and disable it without crashing on import, and on my machine it does. See code here and here. So I believe that the crashes on importing keyring are/were a bug with that package. |
If https://gitlab.com/takluyver/jeepney/-/merge_requests/13 is merged then no changes are needed in SecretStorage or keyring. SecretStorage will convert In case there is a new type of exception that jeepney can raise, I am fine with changing SecretStorage to intercept it. |
https://gitlab.com/takluyver/jeepney/-/merge_requests/13 resolves it as SecretStorage will bubble up the error which keyring handles. |
I'm not certain if this is a jeepney or secretstorage issue, but I'm opening it here. The bug context is that if you have a script (a.py) which performs a secretstorage.dbus_init() and the script uses subprocess to execute another script (b.py) using sudo --preserve-env, the second secretstorage.dbus_init() hangs.
a.py:
b.py
Resulting output
It will hang on the second dbus_init. A ctrl+c results in this traceback:
This is on CentOS8.
Pip freeze
This is the stripped down version of the issue. This also happens if you just
import keyring
which makes it even harder to track down.The text was updated successfully, but these errors were encountered: