Bugzilla – Attachment 2915 Details for
Bug 2341
XQuartz X11 forwarding not working in OS X 10.10 Yosemite
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
OSX X11: if using launchd socket, remove the screen number
openssh-launchd.patch (text/plain), 1.55 KB, created by
Darren Tucker
on 2016-12-15 11:01:01 AEDT
(
hide
)
Description:
OSX X11: if using launchd socket, remove the screen number
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2016-12-15 11:01:01 AEDT
Size:
1.55 KB
patch
obsolete
>diff --git a/channels.c b/channels.c >index bef8ad6..ac56266 100644 >--- a/channels.c >+++ b/channels.c >@@ -4354,6 +4354,30 @@ connect_local_xsocket(u_int dnr) > return connect_local_xsocket_path(buf); > } > >+static int >+is_path_to_xsocket(const char *display, char *path, size_t pathlen) >+{ >+ struct stat sbuf; >+ >+ if (strlcpy(path, display, pathlen) >= pathlen) { >+ error("%s: display path too long", __func__); >+ return 0; >+ } >+ if (stat(path, &sbuf) == 0) { >+ return 1; >+ } else { >+ char *dot = strrchr(path, '.'); >+ if (dot != NULL) { >+ *dot = '\0'; >+ if (stat(path, &sbuf) == 0) { >+ return 1; >+ } >+ } >+ } >+ >+ return 0; >+} >+ > int > x11_connect_display(void) > { >@@ -4375,17 +4399,25 @@ x11_connect_display(void) > * connection to the real X server. > */ > >- /* Check if the display is from launchd. */ > #ifdef __APPLE__ >- if (strncmp(display, "/tmp/launch", 11) == 0) { >- sock = connect_local_xsocket_path(display); >- if (sock < 0) >- return -1; >+ /* Check if display is a path to a socket (as set by launchd). */ >+ { >+ char path[PATH_MAX]; > >- /* OK, we now have a connection to the display. */ >- return sock; >+ if (is_path_to_xsocket(display, path, sizeof(path))) { >+ debug("x11_connect_display: $DISPLAY is launchd"); >+ >+ /* Create a socket. */ >+ sock = connect_local_xsocket_path(path); >+ if (sock < 0) >+ return -1; >+ >+ /* OK, we now have a connection to the display. */ >+ return sock; >+ } > } > #endif >+ > /* > * Check if it is a unix domain socket. Unix domain displays are in > * one of the following formats: unix:d[.s], :d[.s], ::d[.s]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
djm
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2341
:
2585
|
2871
|
2915
|
2916
|
2917