[Bug 2341] XQuartz X11 forwarding not working in OS X 10.10 Yosemite

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Dec 15 11:27:00 AEDT 2016


https://bugzilla.mindrot.org/show_bug.cgi?id=2341

Damien Miller <djm at mindrot.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #2915|ok?(djm at mindrot.org)        |ok+
              Flags|                            |

--- Comment #19 from Damien Miller <djm at mindrot.org> ---
Comment on attachment 2915
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2915
OSX X11: if using launchd socket, remove the screen number

This is ok, my comments are just nitpicks:

>+	if (stat(path, &sbuf) == 0) {
>+		return 1;

no need to wrap the remainder in and else block after return here.

>+	} else {
>+		char *dot = strrchr(path, '.');

I'd stick "char *dot" at the start of the function and do
"if ((dot = strrchr(path, '.')) != NULL {"
on one line, but that's nitpicking :)


> #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;

also nitpicking: maybe we should move this whole lot into a separate
function?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list