Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#13611 closed defect (fixed)

openssh messes up X11 Forwarding

Reported by: andre@… Owned by: skymoo (Adam Mercer)
Priority: Normal Milestone:
Component: ports Version: 1.5.2
Keywords: Cc: skymoo (Adam Mercer)
Port:

Description (last modified by jmpp@…)

andre@prettyboy:~$ ssh -X andre.localhost
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Linux huge 2.6.22-14-386 #1 Sun Oct 14 22:36:54 GMT 2007 i686

You have new mail.
Last login: Mon Dec 17 15:02:18 2007 from prettyboy.local
andre@huge:~$ xhost
/tmp/launch-35O3HH/: unknown host. (nodename nor servname provided, or not known)
X connection to localhost:11.0 broken (explicit kill or server shutdown).
andre@huge:~$ 

Apple's ssh binary works fine. As git-core depends on the openssh port this is giving me a major pain...

andre@prettyboy:~$ ssh -V
OpenSSH_4.7p1, OpenSSL 0.9.8g 19 Oct 2007

Attachments (1)

ssh-x11-percent_expand.diff (3.0 KB) - added by skymoo (Adam Mercer) 16 years ago.
apply Apples patch for X11 forward on Leopard, also fix "percent_expand: NULL replacement" issue

Download all attachments as: .zip

Change History (18)

comment:1 Changed 16 years ago by vinc17@…

/tmp/launch-35O3HH/: unknown host.

I assume you're using Leopard, where Apple introduced a hack so that the X server can be started automatically. Perhaps Apple's ssh has been modified to support this hack? I suggest that you ask in the x11-users list (at lists.apple.com).

Otherwise, you can start the X server manually and set the DISPLAY environment variable to ":0". I don't know if this will work, though.

comment:2 Changed 16 years ago by andre@…

Yes I'm using leopard. And I kind of like Apple's "hack". :)

I thought it was a bug of the port, but since it's a feature of the stock OpenSSH I'll just keep using it. It's a shame that git-core depends on the macports' version though. I'll have to compile Git myself.

Thanks.

comment:3 Changed 16 years ago by vinc17@…

I wonder if the openssh port should be patched...

Now, the fact that git-core depends on the MacPorts' version is probably a bug, as the user can choose whatever ssh client he wants via the GIT_SSH environment variable.

comment:4 Changed 16 years ago by andre@…

I thought so too (about Git). But after reading bug #12865 I think this issue has been raised before and nothing was done...

comment:5 Changed 16 years ago by skymoo (Adam Mercer)

This is the patch that Apple applies to OpenSSH to make it aware of the Launchd X11

http://www.opensource.apple.com/darwinsource/10.5/OpenSSH-87/patches/DVG-5142987_launchd_DISPLAY_for_X11.patch

comment:6 Changed 16 years ago by jmpp@…

Description: modified (diff)
Milestone: Port Bugs

To the original poster: please read WikiFormatting to learn how to properly format terminal output into a ticket. Thanks!

-jmpp

comment:7 Changed 16 years ago by vinc17@…

You can still be able to use Apple's ssh by setting GIT_SSH. Installing git-core will install openssh due to the dependency, but this shouldn't hurt.

BTW, the dependency may be a good idea by default. But a variant to avoid it would probably be a good thing for powerful users as AFAIK, the MacPorts version can't prevent the user from choosing Apple's version via GIT_SSH.

Also, do you really need X11 forwarding for git? I thought SSH was used only to transfer the repository data. You can try: export GIT_SSH="ssh -x" (or use a wrapper script).

comment:8 Changed 16 years ago by andre@…

I use ssh mainly to have a shell on remote servers, that's why I need X11 forwarding.

I don't need X11 forwarding for Git's connections of course but since I have macports bin dir on my $PATH I get the macports's ssh. I can't put the system dir first because, for other things like Perl and Python, I need the macports binaries... At least I think I do since some ports requested them and not the system ones.

comment:9 Changed 16 years ago by skymoo (Adam Mercer)

I've attached a patch that applies Apples patch, along with fixing the "percent_expand: NULL replacement" issue with the proposed upstream patch, taken from <https://bugzilla.mindrot.org/show_bug.cgi?id=1377>

This works for me, could you see if this fixes the problem for you?

Changed 16 years ago by skymoo (Adam Mercer)

Attachment: ssh-x11-percent_expand.diff added

apply Apples patch for X11 forward on Leopard, also fix "percent_expand: NULL replacement" issue

comment:10 Changed 16 years ago by skymoo (Adam Mercer)

Cc: ram@… added

comment:11 Changed 16 years ago by vinc17@…

But you can disable X11 forwarding for git only (thanks to the GIT_SSH environment variable). Even if openssh is patched, this should make connections faster.

comment:12 Changed 16 years ago by andre@…

How do I apply this patch while installing the port?

Is this in the documentation somewhere?

comment:13 Changed 16 years ago by skymoo (Adam Mercer)

cd `port dir openssh`
sudo patch -p2 < /path/to/ssh-x11-percent_expand
sudo port install

should do the trick

comment:14 Changed 16 years ago by andre@…

It worked, thanks.

Still... It would be nice if git-core just used the existing ssh, which is already there.

It just seems a big waste of disk space when we are duplicating everything...

comment:15 Changed 16 years ago by skymoo (Adam Mercer)

Owner: changed from macports-tickets@… to ram@…
Status: newassigned

comment:16 Changed 16 years ago by skymoo (Adam Mercer)

Resolution: fixed
Status: assignedclosed

fixed in r32161

comment:17 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.