int x11_create_display_inet(struct ssh *, int, int, int, u_int *, int **);
--- a/clientloop.c 2017-10-07 04:21:42.000000000 +0200
+++ b/clientloop.c 2017-10-07 04:30:02.000000000 +0200
@@ -301,6 +301,10 @@ client_x11_get_proto(struct ssh *ssh, co
u_int now, x11_timeout_real;
+ int is_path_to_socket = 0;
proto[0] = data[0] = xauthfile[0] = xauthdir[0] = '\0';
@@ -317,6 +321,19 @@ client_x11_get_proto(struct ssh *ssh, co
if (xauth_path != NULL) {
+ * If using launchd socket, remove the screen number from the end
+ * of $DISPLAY. is_path_to_socket is used later in this function
+ * to determine if an error should be displayed.
+ is_path_to_socket = is_path_to_xsocket(display, path, sizeof(path));
* Handle FamilyLocal case where $DISPLAY does
* not match an authorization entry. For this we
@@ -428,6 +445,9 @@ client_x11_get_proto(struct ssh *ssh, co
+ if (!is_path_to_socket)
logit("Warning: No xauth data; "
"using fake authentication data for X11 forwarding.");
strlcpy(proto, SSH_X11_PROTO, sizeof proto);
--- a/channels.c 2017-10-07 04:21:42.000000000 +0200
+++ b/channels.c 2017-10-07 04:26:38.000000000 +0200
@@ -4517,7 +4517,7 @@ connect_local_xsocket(u_int dnr)
is_path_to_xsocket(const char *display, char *path, size_t pathlen)
--- a/channels.h 2017-10-02 21:34:26.000000000 +0200
+++ b/channels.h 2017-10-07 04:26:24.000000000 +0200
@@ -316,6 +316,9 @@ int permitopen_port(const char *);
void channel_set_x11_refuse_time(struct ssh *, u_int);
+int is_path_to_xsocket(const char *, char *, size_t);