Package: x11-common Version: 1:7.7+19 Severity: minor Tags: patch This change closes #658124 ("x11-common: Xsession should not start ssh-agent (should be a user-level choice)") as well as #642012 ("x11-common: ssh-agent Xsession script does not check if gpg-agent will enable SSH support").
It makes it possible for the users to disable ssh-agent (for example if gpg-agent has option enable-ssh-support) by setting $STARTSSHAGENT to empty in ~/.xsessionrc, and to pass extra ssh-agent by setting $SSHAGENTARGS in it. The default behaviour is not changed. Regards
>From b83ec9e283f69e648e93f5e4afa886a7756a11c0 Mon Sep 17 00:00:00 2001 From: "G.raud" <gr...@gmx.com> Date: Mon, 19 Mar 2018 11:18:08 +0100 Subject: [PATCH] 90x11-common_ssh-agent: enable users to disable or configure ssh-agent This closes #658124 as well as #642012 as it allows the user to "manually" disable ssh-agent when enabling enable-ssh-support in gpg-agent. --- debian/local/Xsession.d/90x11-common_ssh-agent | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/debian/local/Xsession.d/90x11-common_ssh-agent b/debian/local/Xsession.d/90x11-common_ssh-agent index 5397434..28a2a5d 100644 --- a/debian/local/Xsession.d/90x11-common_ssh-agent +++ b/debian/local/Xsession.d/90x11-common_ssh-agent @@ -1,24 +1,27 @@ # $Id: 90x11-common_ssh-agent 305 2005-07-03 18:51:43Z dnusinow $ # This file is sourced by Xsession(5), not executed. -STARTSSH= +#STARTSSHAGENT= can be set in $USERXSESSIONRC SSHAGENT=/usr/bin/ssh-agent -SSHAGENTARGS= +#SSHAGENTARGS= can be set in $USERXSESSIONRC -if has_option use-ssh-agent; then - if [ -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 - # use ssh-agent2's ssh-agent1 compatibility mode - SSHAGENTARGS=-1 - fi +if has_option use-ssh-agent \ + && [ -x "$SSHAGENT" ] && [ -z "$SSH_AUTH_SOCK" ] \ + && [ -z "$SSH2_AUTH_SOCK" ]; then + if [ -z "${STARTSSHAGENT+set}" ]; then + STARTSSHAGENT=yes fi + if [ -f /usr/bin/ssh-add1 ] && cmp -s $SSHAGENT /usr/bin/ssh-agent2; then + # use ssh-agent2's ssh-agent1 compatibility mode + SSHAGENTARGS="-1 $SSHAGENTARGS" + fi +else + STARTSSHAGENT= fi -if [ -n "$STARTSSH" ]; then +if [ -n "$STARTSSHAGENT" ]; then STARTUP="$SSHAGENT $SSHAGENTARGS ${TMPDIR:+env TMPDIR=$TMPDIR} $STARTUP" fi # vim:set ai et sts=2 sw=2 tw=80: -- 2.16.2