Bug 812783

Summary: ssh-agent not detected in sys.xsession
Product: [openSUSE] openSUSE 12.3 Reporter: Wolfgang Rosenauer <wolfgang>
Component: X.OrgAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Normal    
Priority: P5 - None CC: forgotten_B-7XM5iatA, sndirsch
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Wolfgang Rosenauer 2013-04-01 19:05:36 UTC
I'm using pam_ssh since ages to authenticate via PAM and also create the ssh-agent with my private keys loaded.

With 12.3 that does not work anymore. I always get a new ssh-agent started for my WindowMaker session and my unlocked keys are not known to that one.

I've tried to debug that a bit but only was able to follow it into sys.xsession:

-----
if test "$usessh" = yes -a -d "$HOME/.ssh" && sshagent=$(type -p ssh-agent) ; then
    if test -S "$SSH_AUTH_SOCK" ; then
        logger "xsession: pid $SSH_AGENT_PID"
        checkproc -p $SSH_AGENT_PID $sshagent
        error=$?
        logger "xsession: checkproc return $error"
        if test -n "$SSH_AGENT_PID" && checkproc -p $SSH_AGENT_PID $sshagent ; then
            export SSH_AGENT_PID SSH_AUTH_SOCK
        else
            rm -f "$SSH_AUTH_SOCK"
            case "${SSH_AUTH_SOCK%/*}" in
            /tmp/*) rm -rf "${SSH_AUTH_SOCK%/*}"
            esac
            unset SSH_AUTH_SOCK
        fi
-----

checkproc -p $SSH_AGENT_PID $sshagent returns exit code 7

but I've verified with debug output that SSH_AGENT_PID contains a valid and current pid of an "ssh-agent -s" process.

Actually executing it with the actual data like
wolfi@Hygiea:~> /sbin/checkproc -p 6168 /usr/bin/ssh-agent
wolfi@Hygiea:~> echo $?
0

works correctly.
Just within sys.xsession it fails for a reason I don't know.

I did a "ps ax | grep $SSH_AGENT_PID" in the script and it returned the process "ssh-agent -s" correctly but still checkproc failed.
Comment 1 Wolfgang Rosenauer 2013-04-08 15:15:08 UTC
Adding (best guess) xdm maintainer to CC

wolfi@Hygiea:~> osc maintainer openSUSE:Factory xdm
bugowner of X11:XOrg : 
 -

maintainer of X11:XOrg : 
 sndirsch, mhopf, eeich, michalsrb
Comment 2 Dr. Werner Fink 2013-04-09 06:43:33 UTC
Please remove the `-k' option from within the checkproc shell function as this seems to cause the trouble with special programs like ssh-agent.  Such programs do have an /proc/<pid>/exec links which is not readable by the user used for that program.
Comment 3 Wolfgang Rosenauer 2013-04-09 09:54:04 UTC
removing the -k fixed the issue for me, thanks
Comment 4 Stefan Dirsch 2013-04-10 08:11:44 UTC
Wolfgang, do you believe we need a fix for 12.3 or would a fix in obs://X11:XOrg and for openSUSE:Factory be sufficient? I would take care of the latter. You could help me with the former. ;-)
Comment 5 Wolfgang Rosenauer 2013-04-10 20:13:16 UTC
(In reply to comment #4)
> Wolfgang, do you believe we need a fix for 12.3 or would a fix in
> obs://X11:XOrg and for openSUSE:Factory be sufficient? I would take care of the
> latter. You could help me with the former. ;-)

I would rather like to see an update as well. And I can take care about the branching/submitting for that.
Comment 6 Stefan Dirsch 2013-04-11 11:08:30 UTC
Ok. Fixed in obs://X11:XOrg/xdm and submitrequested for openSUSE:Factory. Wolfgang, could you take care of the update for openSUSE 12.3? Thanks.
Comment 7 Bernhard Wiedemann 2013-04-11 19:00:06 UTC
This is an autogenerated message for OBS integration:
This bug (812783) was mentioned in
https://build.opensuse.org/request/show/163690 Maintenance /
Comment 8 Bernhard Wiedemann 2013-04-13 15:00:07 UTC
This is an autogenerated message for OBS integration:
This bug (812783) was mentioned in
https://build.opensuse.org/request/show/163884 Maintenance /
Comment 9 Benjamin Brunner 2013-04-22 14:55:19 UTC
Update released for openSUSE 12.3. Resolved fixed.
Comment 10 Stefan Dirsch 2013-04-30 10:31:25 UTC
*** Bug 813278 has been marked as a duplicate of this bug. ***
Comment 11 Swamp Workflow Management 2013-06-10 09:16:39 UTC
openSUSE-RU-2013:0907-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 812783
CVE References: 
Sources used:
openSUSE 12.3 (src):    xdm-1.1.10-14.6.1