! 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 !
xfce-utils/scripts/xinitrc.in.in: Don't start ssh-agent and gpg-agent
Status:
RESOLVED: FIXED
Product:
Xfce4-session
Component:
General

Comments

Description Robby Workman editbugs 2010-12-20 07:18:49 CET
Created attachment 3294 
Patch with parent of 5758c9e244efc0f2c5d73d003e4fc0589c6d8e42

xfce-utils/scripts/xinitrc.in.in: Don't start ssh-agent and gpg-agent

Users who want to start these agents can make use of the XDG
autostart directories, $HOME/.xprofile, and/or the various
distribution-specific methods to launch stuff on DE startup.
Having these started by Xfce unnecessarily complicates things
for users that want to use e.g. gnome-keyring's implementations
of the ssh and/or gpg agent.
Comment 1 Jérôme Guelfucci editbugs 2011-01-13 00:33:36 CET
I don't really care about this, sounds ok. This is "geek" stuff anyway.

Jannis, Nick, what do you think about this?
Comment 2 Nick Schermer editbugs 2011-01-13 13:26:00 CET
This was added for a reason; benny? olivier?
Comment 3 Jannis Pohlmann editbugs 2011-01-29 15:25:48 CET
Yeah, I bet it has been added on purpose. I would like to know why out of a sudden this code is becoming a problem.
Comment 4 Robby Workman editbugs 2011-01-29 16:15:18 CET
The problem is that there's no way to tell xfce that I want to use gnome-keyring as my ssh agent and/or gpg agent - it automatically starts ssh-agent and gpg-agent for me, regardless of whether that's what I want to use.  

Probably that was fine when those were the only options available -- if you wanted an agent at all, then that's what you used, and if you didn't want/need one, then no harm was done by starting them anyway.  These days, there are options, and those options are even supported indirectly by xfce (enable gnome services on startup), so it seems like this should be something that the user sets up to start from $HOME/.profile, $HOME/.xprofile, or wherever.
Comment 5 Landry Breuil editbugs 2011-02-08 09:04:11 CET
The option to start ssh/gpg-agent using xinitrc can't work atm, as it relies on the xfconf key /startup/ssh-agent/enabled (in xfce4-session channel), and nothing in xfce4-session allows you to set that key. That is a first part of the issue.

From my understanding, people wanting to use gnome-keyring should just set 'start gnome services', as it's exactly what it does (start gnome-keyring)

Another way is to set SSH_ASKPASS in environment.

But please, don't remove that part from xinitrc. We should readd a way to change the xfconf key to xfce4-session-settings though.
Comment 6 Landry Breuil editbugs 2011-02-08 09:22:50 CET
From what i understand, unless someone does 

xfconf-query -c xfce4-session -n -v -p /startup/ssh-agent/enabled -t bool -s true

to set that key manually, xinitrc wont start ssh-agent.

This was added in http://git.xfce.org/xfce/xfce-utils/commit/?id=47b3b58052dbdb6424c6303989727eaac02aab41
 but nothing more was done to integrate it into the ui.
Comment 7 Mark Trompell 2011-02-08 09:43:02 CET
if 'start gnome services' starts gnome-keyring. That option should probably disable {ssh,gpg}-agent
Comment 8 Yves-Alexis Perez editbugs 2011-02-08 09:47:25 CET
This is the same thing than consolekit. Imho it's not Xfce role to determine if the user wants or not those daemon to be started.

Some of them (xscreensaver for example) should be started from .config/autostart since they don't need to export anything to the environment.

The other (*-agent, consolekit etc.) should install themselves their startup file and agree on a way for the user to select this. But it has to be cross-distro and cross-desktop or it won't really work.

Debian does it using scripts (installed by packages themselves) in /etc/X11/Xsession.d and global configuration in /etc/X11/Xsession.options. There's no support for a $HOME/.Xsession.options but I guess that might be possible.

All in all, I think this should happen on freedesktop.org list (either X, distrib@ or a cross-desktop) one (fd.o is not Linux-specific, is it?)
Comment 9 Nick Schermer editbugs 2012-02-24 22:22:09 CET
If the shutdown of the agent is not required, we can move this to autostart.
Comment 10 Guido Berhoerster 2012-02-25 15:43:34 CET
(In reply to comment #9)
> If the shutdown of the agent is not required, we can move this to autostart.

Please note that ssh/gpg-agents cannot be handled through xdg autostart mechanisms since they must set environment variables for the session, in case of gnome-keyring these are passed through a DBus interface to the GNOME session manager.
Comment 11 Nick Schermer editbugs 2012-02-25 19:16:31 CET
But we can easily add that to the session manager. So then autostart would be a nicer solution i guess.
Comment 12 Guido Berhoerster 2012-02-25 20:12:27 CET
(In reply to comment #11)
> But we can easily add that to the session manager. So then autostart would be a
> nicer solution i guess.

Only gnome-keyring supports this DBus interface, the only generic way supported by ssh-agent/gpg-agent/gnome-keyring is to read the environment variables they print to stdout and to put them in the environment of the session manager (i.e. what the script used to do). I don't see any nice way to accomplish that with xdg autostart files.
xfce4-session already already uses the above method to start gnome-keyring when GNOME compatibility mode is enabled (although that currently has undesired side effects see bug #8014), this could be made more generic with a new configuration option for the GPG/SSH agent to start on login.
Comment 13 Nick Schermer editbugs 2012-04-19 20:58:49 CEST
Cooked this in the session manager.
Comment 14 Nick Schermer editbugs 2012-04-19 21:49:01 CEST
Forgot to ask, but maybe some people can try the new code before 4.10. I've used it here and everything seems to work fine, but some more testing would be nice.

The /startup/ssh-agent/enabled and /startup/ssh-agent/type properties still work.

Bug #7018

Reported by:
Robby Workman
Reported on: 2010-12-20
Last modified on: 2012-04-19

People

Assignee:
Xfce Bug Triage
CC List:
8 users

Version

Attachments

Additional information