Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 738244 - gnome-base/gvfs-1.42.2 not making use of env passed via dbus
Summary: gnome-base/gvfs-1.42.2 not making use of env passed via dbus
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-20 18:31 UTC by haarp
Modified: 2020-08-25 08:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description haarp 2020-08-20 18:31:11 UTC
Hello,

gvfsd can mount, among other things, SFTP endpoints (e.g. `gio mount sftp://server/data`) and make use of ssh-agent for this. gvfsd needs to know ssh-agent's SSH_AUTH_SOCK, which xfce4-session should handle via dbus (see https://git.xfce.org/xfce/xfce4-session/commit?id=2cf63e66c0285aaeee76155f463c85d04da6addc)

However, on OpenRC Gentoo, this does not work. gvfsd will not make use of ssh-agent and instead prompt for a password.

xfce4-session will try either of these commands:

dbus-update-activation-environment --systemd SSH_AUTH_SOCK
dbus-update-activation-environment SSH_AUTH_SOCK

When executed manually, the former would not work on my elogind system (The name org.freedesktop.systemd1 was not provided by any .service files), while the latter claimed successful execution (> dbus-update-activation-environment --verbose SSH_AUTH_SOCK
dbus-update-activation-environment: setting SSH_AUTH_SOCK=/tmp/ssh-vG8IPaEHAAAA/agent.2971)

But subsequently gvfsd would still not make use of the ssh-agent.

However, if gvfsd restarted with SSH_AUTH_SOCK already set in its env (or if it's inserted via gdb into a running gvfsd), gvfsd WILL make use of ssh-agent.

I cannot tell if this is a bug in gvfsd, dbus, OpenRC, elogind or something else (lack of systemd?). This bug exists on both Consolekit and elogind systems.


Also see https://gitlab.gnome.org/GNOME/gnome-session/-/issues/66


Thanks!
Comment 1 haarp 2020-08-25 07:58:39 UTC
For reference, this is how I manually hackily inject SSH_AUTH_SOCK into a running gvfsd (assuming SSH_AUTH_SOCK is available in the shell it's executed in):

gdb -batch -ex "attach $(pidof gvfsd)" -ex "call (int) putenv(\"SSH_AUTH_SOCK=$SSH_AUTH_SOCK\")" -ex "detach"