[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#658124: x11-common: Xsession should not start ssh-agent (should be a user-level choice)



On Wed, Feb 01, 2012 at 09:27:43PM +0100, Julien Cristau wrote:
> On Tue, Jan 31, 2012 at 15:46:28 +0100, Vincent Lefevre wrote:
> > Note: /etc/X11/Xsession.d/90x11-common_ssh-agent does some checks
> > e.g. by testing whether $SSH_AUTH_SOCK is set, but unfortunately it
> > is sourced before the user can get the control on the environment,
> > so that there is no good workaround.
> > 
> unset SSH_AUTH_SOCK in ~/.xsessionrc wouldn't work?

As pointed out, that's a hack. More clear is this (untested) patch,
which will honor STARTSSH pulled in from, e.g. .xsessionrc

--- 90x11-common_ssh-agent      2017-04-24 12:56:05.131727153 +0200
+++ /etc/X11/Xsession.d/90x11-common_ssh-agent  2017-04-24 13:03:33.568948463 +0200
@@ -2,12 +2,12 @@

 # This file is sourced by Xsession(5), not executed.

-STARTSSH=
+STARTSSH=${SSHAGENT:-}
 SSHAGENT=/usr/bin/ssh-agent
 SSHAGENTARGS=

 if has_option use-ssh-agent; then
-  if [ -x "$SSHAGENT" ] && [ -z "$SSH_AUTH_SOCK" ] \
+  if [ -z "$STARTSSH" ] && [ -x "$SSHAGENT" ] && [ -z "$SSH_AUTH_SOCK" ] \
      && [ -z "$SSH2_AUTH_SOCK" ]; then
     STARTSSH=yes
     if [ -f /usr/bin/ssh-add1 ] && cmp -s $SSHAGENT /usr/bin/ssh-agent2; then

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421


Reply to: