Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 3138 - ssh-agent in xdm session startup
Summary: ssh-agent in xdm session startup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Low enhancement (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-28 20:31 UTC by John Hensley
Modified: 2003-01-28 00:30 UTC (History)
2 users (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 John Hensley 2002-05-28 20:31:18 UTC
I've gotten used to having my X sessions started with ssh-agent, so I'm 
including my diff to /etc/X11/xdm/Xsession from xfree-4.2.0-r10. The 
non-chooser cases need to be tested. 
 
If you'd prefer to incorporate a known quantity, Debian and OpenBSD both do 
this. Debian has an /etc/X11/Xsession.d containing a number of scripts, one of 
which sets up ssh-agent. OpenBSD's is more straightforward, but I'm unclear on 
the benefit of not simply using ssh-agent to exec the session. Anyway, you can 
check OpenBSD's out via CVSweb at: 
 
http://www.openbsd.org/cgi-bin/cvsweb/XF4/xc/programs/xdm/config/Xsession?rev=1.6&content-type=text/x-cvsweb-markup 
 
Here's the diff: 
 
--- Xsession.orig       Tue May 28 19:32:59 2002 
+++ Xsession    Tue May 28 21:22:40 2002 
@@ -26,17 +26,20 @@ fi 
 startup=$HOME/.xsession 
 resources=$HOME/.Xresources 
 
+SSH_AGENT="" 
+[ -x /usr/bin/ssh-agent ] && SSH_AGENT=/usr/bin/ssh-agent 
+ 
 if [ -n "`/etc/X11/chooser.sh`" ]; then 
-       exec "`/etc/X11/chooser.sh`" 
+       exec ${SSH_AGENT} "`/etc/X11/chooser.sh`" 
 elif [ -s "$startup" ]; then 
        if [ -x "$startup" ]; then 
-               exec "$startup" 
+               exec ${SSH_AGENT} "$startup" 
        else 
-               exec /bin/sh "$startup" 
+               exec ${SSH_AGENT:-/bin/sh} "$startup" 
        fi 
 else 
        if [ -r "$resources" ]; then 
                xrdb -load "$resources" 
        fi 
-       exec xsm 
+       exec ${SSH_AGENT} xsm 
 fi
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-05-29 05:04:24 UTC
have you considered keychain?
Comment 2 John Hensley 2002-05-31 22:23:38 UTC
Doh! I hadn't, but it looks good. Thanks.