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

DBUS_SESSION_BUS_ADDRESS not set when running tomb via .desktop launcher #429

Open
AimoE opened this issue Nov 2, 2021 · 1 comment
Open
Labels
desktop usage on desktop environments enhancement An issue to improve current behavior help wanted An issue open for contributors to help

Comments

@AimoE
Copy link

AimoE commented Nov 2, 2021

I am using tomb in Ubuntu 20.04 (which has Gnome desktop). I have a script which runs fine on bash command line. I also run the same script via a .desktop launcher, which has "Terminal=True" set, because I want to see all the messages that the script emits.

When the script runs all tomb commands with sudo, I get "No $DBUS_SESSION_BUS_ADDRESS found, falling back to curses" for any the tomb commands that refer to a key, and I have to type the passwords for the keys in the terminal window in a clumsy manner.

However, when the script runs all tomb commands without sudo, I get a neat separate pop-up window whenever a password is needed for a tomb key. For the first tomb command, I also get a prompt for sudo password in the terminal window (because my sudoers setting does not apply).

Is this a bug or a feature, and is there something I could do to get DBUS_SESSION_BUS_ADDRESS set for the tomb commands in this setup?

@Narrat
Copy link
Collaborator

Narrat commented Dec 4, 2021

The env var is tied to a specific user. For example:
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
So as you invoke tomb with sudo this env isn't available. The reason for this? Depends on your setup and settings? It could be running with a different user, sudo not inheriting env vars. Sadly I'm currently not really sure, but it is more due to a feature and not of a bug in tomb. At least this is my assumption.
There were recently changes in regards of privilege escalation. Maybe there got something included which helps in this case

@jaromil jaromil added the enhancement An issue to improve current behavior label Jan 29, 2024
@jaromil jaromil added desktop usage on desktop environments help wanted An issue open for contributors to help labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop usage on desktop environments enhancement An issue to improve current behavior help wanted An issue open for contributors to help
Projects
None yet
Development

No branches or pull requests

3 participants