Bug 648896

Summary: "connect : Connection refused" messages when X forwarding but it still works
Product: [Fedora] Fedora Reporter: Paul Howarth <paul>
Component: opensshAssignee: Jan F. Chadima <jchadima>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: anielsen, horsley1953, imc, james, jchadima, mgrepl, tmraz, wd
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openssh-5.5p1-23.fc14.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-08 22:31:59 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:
Attachments:
Description Flags
Proposed fix none

Description Paul Howarth 2010-11-02 13:08:52 UTC
Description of problem:
When using ssh -X/Y from a Fedora 14 box (to a Fedora 13 box in my case), I see error messages "connect : Connection refused" from time to time when running commands in the terminal. I noticed it when using mock but it does the same for simple applications like gnome-about too. The strange thing is, everything still works.

Version-Release number of selected component (if applicable):
openssh-5.5p1-22.fc14.2.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1. ssh -X or ssh -Y from a Fedora 14 box.
2. run gnome-about
  
Actual results:
$ gnome-about
connect : Connection refused
connect : Connection refused
connect : Connection refused
connect : Connection refused
(gnome-about window opens and functions as normal)
$ 

Expected results:
$ gnome-about
(gnome-about window opens and functions as normal)
$ 

Additional info:
Also noticed elsewhere:
http://compgroups.net/comp.os.linux.misc/Fedora-14-ssh-problem

Comment 1 Ian Collier 2010-11-05 15:27:56 UTC
An strace shows that in trying to set up an X11 connection, the ssh client does:

socket(PF_FILE, SOCK_STREAM, 0)         = 7
connect(7, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 110) = -1 ECONNREFUSED
close(7)                                = 0
write(2, "connect : Connection refused\r\n", 30) = 30
socket(PF_FILE, SOCK_STREAM, 0)         = 7
connect(7, {sa_family=AF_FILE, path="/tmp/.X11-unix/X0"}, 110) = 0

Google tells me that the at-sign in the first connection attempt means that the path is an abstract socket, signified by adding a NUL byte to the beginning of the name.  And the reason why it fails is because the length value in the third argument to connect must be just enough to cover the abstract socket name and no more - the socket name is not NUL-terminated as it is in the case of a non-abstract socket.

Comment 2 Ian Collier 2010-11-05 15:56:53 UTC
Created attachment 458132 [details]
Proposed fix

Looking at the source of openssh I notice that this is a Fedora patch (openssh-5.5p1-x11.patch) which wasn't quite implemented correctly.

The fix is fairly trivial.  The attached patch applied after x11.patch fixes the issue (but I guess in the release should be merged into x11.patch).

Comment 3 Fedora Update System 2010-11-05 17:23:39 UTC
openssh-5.5p1-23.fc14.2 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/openssh-5.5p1-23.fc14.2

Comment 4 Fedora Update System 2010-11-06 23:42:00 UTC
openssh-5.5p1-23.fc14.2 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update openssh'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/openssh-5.5p1-23.fc14.2

Comment 5 Fedora Update System 2010-11-08 22:31:54 UTC
openssh-5.5p1-23.fc14.2 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Tom Horsley 2010-11-09 15:05:33 UTC
*** Bug 651413 has been marked as a duplicate of this bug. ***

Comment 7 Tomas Mraz 2010-11-09 16:09:43 UTC
*** Bug 651449 has been marked as a duplicate of this bug. ***