Bug 648896 - "connect : Connection refused" messages when X forwarding but it still works
"connect : Connection refused" messages when X forwarding but it still works
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: openssh (Show other bugs)
14
Unspecified Unspecified
low Severity medium
: ---
: ---
Assigned To: Jan F. Chadima
Fedora Extras Quality Assurance
:
: 651413 651449 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-02 09:08 EDT by Paul Howarth
Modified: 2010-11-09 11:09 EST (History)
8 users (show)

See Also:
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 17:31:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Proposed fix (665 bytes, patch)
2010-11-05 11:56 EDT, Ian Collier
no flags Details | Diff

  None (edit)
Description Paul Howarth 2010-11-02 09:08:52 EDT
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 11:27:56 EDT
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 11:56:53 EDT
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 13:23:39 EDT
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 19:42:00 EDT
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 17:31:54 EST
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 10:05:33 EST
*** Bug 651413 has been marked as a duplicate of this bug. ***
Comment 7 Tomas Mraz 2010-11-09 11:09:43 EST
*** Bug 651449 has been marked as a duplicate of this bug. ***

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