Bug 90158
| Summary: | Xsession overrides login ssh-agent | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | Bruce Lowekamp <lowekamp> | ||||||
| Component: | xinitrc | Assignee: | X/OpenGL Maintenance List <xgl-maint> | ||||||
| Status: | CLOSED RAWHIDE | QA Contact: | David Lawrence <dkl> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 9 | CC: | dgunchev, rdieter | ||||||
| Target Milestone: | --- | Keywords: | EasyFix, Triaged | ||||||
| Target Release: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | 4.0.7-1 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2004-10-05 08:19:52 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Bug Depends On: | |||||||||
| Bug Blocks: | 123268 | ||||||||
| Attachments: |
|
||||||||
|
Description
Bruce Lowekamp
2003-05-03 21:23:42 UTC
Created attachment 91491 [details]
proposed new Xsession file
This proposed new Xsession runs the ssh-agent prior to invoking the user's
shell and the appropriate session manager.
It is organized somewhat differently than the original to make sure that:
-the failsafe runs first regardless of the other options
-the ssh-agent runs next before anything else happens
I believe that with this Xsession, someone relying on the behavior of the
earlier Xsession's (before ssh-agent starting was added) or the behavior in 9.0
(with ssh-agent starting) will not see any change.
Starting the ssh-agent at all may change the behavior of some people's oldre
scripts, but those scripts can easily be modified. With the current
configuration, there's no way to fix it within a .login file.
The following code segment in a .login now works with the old Xsession, my
revised Xsession, console terminal login, and remote terminal login:
ssh-add -l >& /dev/null
set sshstatus=$status
if ($sshstatus == 2) then
eval `ssh-agent`
ssh-add
else if ($sshstatus == 1) then
ssh-add
endif
I use a shell script that starts ssh-agent from my .bash_profile.
This script checks if there's running ssh-agent and starts new one if
not. SSH_AUTH_SOCK, SSH_AGENT_PID and one shell variable for internal
use are exported and saved in a temp file. Non-login shells (for X)
read these from it (via .bashrc). When I login on another console or
open new X terminal my ssh keys are available to them. The script also
kills ssh-agent at exit.
This worked and still works without X, but with it in FC1 I have
two ssh-agents (one from X) and no variables exported. When I first
login from XDM I get a dialog to enter my passphrase (If I ssh-add
from the script), but nothing works because the 'exported' variables
are not really exported.
Created attachment 102506 [details]
Patch to xinitrc-3.42-1 Xsession
Patch to xinitrc-3.42-1 Xsession to check is SSH_AGENT_PID is set before
setting SSHAGENT
I've reviewed this request, and the attached files. It is a sane request which I believe is safe and also the right thing to do. One thing I noticed while adding this request, is that Xsession and xinitrc share about 80% of their code, however fixes often get put into one but left out of the other (such as was the case here). I'm going to refactor the common code out into a single file which both of these scripts source in the future, so we don't have unnecessary code duplication, and bugs getting fixed in only one place, etc. Thanks for the suggested fix Daniel, it'll be in xinitrc 4.0.7-1 in rawhide soon. |