Tomb icon indicating copy to clipboard operation
Tomb copied to clipboard

DBUS_SESSION_BUS_ADDRESS not set when running tomb via .desktop launcher

Open AimoE opened this issue 4 years ago • 1 comments

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?

AimoE avatar Nov 02 '21 16:11 AimoE

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

Narrat avatar Dec 04 '21 20:12 Narrat