Bug 32229 - xinitrc should use ssh-agent
xinitrc should use ssh-agent
Product: Red Hat Linux
Classification: Retired
Component: xinitrc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
Aaron Brown
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2001-03-19 10:18 EST by Dan Morrill
Modified: 2007-04-18 12:32 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-10-25 18:06:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to use ssh-agent when available. (2.41 KB, patch)
2001-03-19 16:58 EST, Douglas Kilpatrick
no flags Details | Diff

  None (edit)
Description Dan Morrill 2001-03-19 10:18:52 EST
Since openssh is now legal for export and is included by default w/ Red 
Hat, etc., xinitrc should be configured to use ssh-agent by default, if 
it is present.

(i.e. inside a `if [ -x /usr/bin/ssh-agent ]; then` block)
Comment 1 Douglas Kilpatrick 2001-03-19 10:30:43 EST
if [ -x /usr/bin/ssh-agent]; then

then all the exec lines become
exec $SSH_AGENT <foo>

Not that I've done this by hand to every RH distro since 6.0... no, not at all. 
Nor have I added ssh-add to the autorun folders on all those systems

You want a patch?
Comment 2 Mike A. Harris 2001-03-19 14:46:10 EST
Sure, send me a patch.  I can't guarantee it will get into our next
release, however, if it doesn't, I will certinly try to add the
functionality into XFree ASAP after that, perhaps in an errata.
Comment 3 Douglas Kilpatrick 2001-03-19 16:58:24 EST
Created attachment 13065 [details]
patch to use ssh-agent when available.
Comment 4 Douglas Kilpatrick 2001-03-19 16:59:35 EST
not tested, but looks "obviously right"  needs "%patch0 -p1" in .spec file.
Comment 5 Douglas Kilpatrick 2001-03-19 17:12:29 EST
quick test.  "Works For Me(TM)", both w/ ssh-agent and w/o.
Comment 6 Mike A. Harris 2001-03-23 00:50:30 EST
Ok thanks.  I'll look into this for a future release.  Looks like a good
idea to me.
Comment 7 Mike A. Harris 2001-10-25 18:06:01 EDT
I've investigated the attached patch, and discussed it with a few
other developers here.  One problem with this patch is that it
does not do anything to detect an already running ssh-agent, nor
does it try to shut down ssh-agent on exit.

In order for such a patch to become part of the shipping XFree86,
it needs to be clean, and handle this.  A few people here have
tried to implement this already but were unable to come up with
a clean solution.
Comment 8 Mike A. Harris 2001-10-25 18:09:36 EDT
I'm closing this as I do not see enough benefit returned for
engineering time that would be spent trying to solve this,
and test and debug it until it works properly.

(Another case it would have to handle, is the case where a user
already starts ssh-agent from ~/.bash_profile, or similar)
Comment 9 Douglas Kilpatrick 2001-10-25 22:47:12 EDT
1) Quiting SSH agent.

When ssh-agent is run with an argument following, it exits when the program 
following it does.  Fer example:

$ ssh-agent bash
$ ps auwwx | grep 9240
kilpatds  9240  0.0  0.3  2388  792 ?        S    22:38   0:00 ssh-agent bash
kilpatds  9267  0.0  0.2  1732  600 pts/3    R    22:38   0:00 grep 9240
$ exit
$ ps auwwx | grep 9240
kilpatds  9282  0.0  0.2  1732  600 pts/3    S    22:38   0:00 grep 9240

As the patch in question executed the rest of the Xclient stuff from 
ssh-agent, stopping ssh agent doesn't matter.

2) Detecting an already running one.

Yep, I missed that.

test -n "$SSH_AGENT_PID" && kill -0 $SSH_AGENT_PID && echo "already running"

Anything else I need to cover?  You want me to start maintaining a patch?

Note You need to log in before you can comment on or make changes to this bug.