! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
thunar, gvfs, ssh-agent -- gvfs does not use xfce4-session spawned ssh-agent
Status:
RESOLVED: FIXED
Product:
Xfce4-session
Component:
General

Comments

Description Jamin Collins 2017-04-09 03:47:01 CEST
Created attachment 7071 
call dbus-update-activation-environment after starting ssh-agent

Allowing xfce4-session to manage starting ssh-agent for me resulted in gvfs requests not making use of the ssh-agent.

Much of the issue is described in this Arch Linux bug report:
https://bugs.archlinux.org/task/46398

The workaround listed in the bug report does work.  Specifcally:
dbus-update-activation-environment --systemd SSH_AUTH_SOCK
pkill gvfs

From this point on, gvfs request through Thunar successfully make use of the ssh-agent.

However, I wanted to find a way to have everything working as expected immediately after login without need to apply a workaround.  The attached patch appears to do so.  Please consider including it.
Comment 1 haarp 2017-06-21 10:16:16 CEST
A workaround:

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

this injects SSH_AUTH_SOCK into gvfsd's environment.
Comment 2 Jamin Collins 2017-07-17 16:30:48 CEST
The above "workaround" will not work on many systems:

https://linux-audit.com/protect-ptrace-processes-kernel-yama-ptrace_scope/

including mine:
$ cat /proc/sys/kernel/yama/ptrace_scope
1

However, the provided patch does fix this problem without requiring the user to make other modifications.  Please consider including it.
Comment 3 Git Bot editbugs 2017-07-18 17:19:15 CEST
Eric Koegel referenced this bugreport in commit 2cf63e66c0285aaeee76155f463c85d04da6addc

Export the SSH_AUTH_SOCK when spawning client (Bug #13486)

https://git.xfce.org/xfce/xfce4-session/commit?id=2cf63e66c0285aaeee76155f463c85d04da6addc
Comment 4 Eric Koegel editbugs 2017-07-19 04:59:53 CEST
Thanks for the patch!

Bug #13486

Reported by:
Jamin Collins
Reported on: 2017-04-09
Last modified on: 2020-04-29

People

Assignee:
Xfce Bug Triage
CC List:
5 users

Version

Version:
4.12.0

Attachments

Additional information