[121201] trunk/dports/net/openssh

jeremyhu at macports.org jeremyhu at macports.org
Thu Jun 19 19:01:12 PDT 2014


Revision: 121201
          https://trac.macports.org/changeset/121201
Author:   jeremyhu at macports.org
Date:     2014-06-19 19:01:12 -0700 (Thu, 19 Jun 2014)
Log Message:
-----------
openssh: Update launchd.patch to match similar changes in libxcb

Modified Paths:
--------------
    trunk/dports/net/openssh/Portfile
    trunk/dports/net/openssh/files/launchd.patch

Modified: trunk/dports/net/openssh/Portfile
===================================================================
--- trunk/dports/net/openssh/Portfile	2014-06-19 21:49:39 UTC (rev 121200)
+++ trunk/dports/net/openssh/Portfile	2014-06-20 02:01:12 UTC (rev 121201)
@@ -5,7 +5,7 @@
 
 name                openssh
 version             6.6p1
-revision            2
+revision            3
 categories          net
 platforms           darwin
 maintainers         nomaintainer

Modified: trunk/dports/net/openssh/files/launchd.patch
===================================================================
--- trunk/dports/net/openssh/files/launchd.patch	2014-06-19 21:49:39 UTC (rev 121200)
+++ trunk/dports/net/openssh/files/launchd.patch	2014-06-20 02:01:12 UTC (rev 121201)
@@ -1,48 +1,57 @@
---- a/clientloop.c	2014-03-17 00:22:44.000000000 -0700
-+++ b/clientloop.c	2014-03-17 00:29:45.000000000 -0700
-@@ -313,6 +313,11 @@
+diff --git a/clientloop.c b/clientloop.c
+index 59ad3a2..724acf4 100644
+--- a/clientloop.c
++++ b/clientloop.c
+@@ -313,6 +313,10 @@ client_x11_get_proto(const char *display, const char *xauth_path,
  	struct stat st;
  	u_int now;
  
 +#if __APPLE__
-+	char *strptr = NULL;
-+	int is_launchd = 0, len_to_screen = 0;
++	int is_path_to_socket = 0;
 +#endif /* __APPLE__ */
 +
  	xauthdir = xauthfile = NULL;
  	*_proto = proto;
  	*_data = data;
-@@ -328,6 +333,24 @@
+@@ -328,6 +332,32 @@ client_x11_get_proto(const char *display, const char *xauth_path,
  			debug("x11_get_proto: DISPLAY not set");
  			return;
  		}
 +#if __APPLE__
-+		/*
-+		 * If using launchd socket, then remove the screen number from
-+		 * end of $DISPLAY. is_launchd is used later in this function
-+		 * to determine if an error should be displayed.
-+		 */
-+		if (strncmp(display, "/tmp/launch-", 12) == 0) {
-+			is_launchd = 1;
-+			if (NULL != (strptr = rindex(display, ':')) &&
-+			    NULL != (strptr = index(strptr, '.'))) {
-+				debug("x11_get_proto: $DISPLAY is launchd, removing screennum");
-+				len_to_screen = strptr - display;
-+				strlcpy(xdisplay, display, (len_to_screen + 1));
-+				display = xdisplay;
-+				setenv("DISPLAY", display, 1);
++		{
++			/*
++			 * 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.
++			 */
++			char path[PATH_MAX];
++			struct stat sbuf;
++
++			strlcpy(path, display, sizeof(path));
++			if (0 == stat(path, &sbuf)) {
++				is_path_to_socket = 1;
++			} else {
++				char *dot = strrchr(path, '.');
++				if (dot) {
++					*dot = '\0';
++					/* screen = atoi(dot + 1); */
++					if (0 == stat(path, &sbuf)) {
++						debug("x11_get_proto: $DISPLAY is launchd, removing screennum");
++						setenv("DISPLAY", path, 1);
++					}
++				}
 +			}
 +		}
 +#endif /* __APPLE__ */
  		/*
  		 * Handle FamilyLocal case where $DISPLAY does
  		 * not match an authorization entry.  For this we
-@@ -407,6 +430,9 @@
+@@ -407,6 +437,9 @@ client_x11_get_proto(const char *display, const char *xauth_path,
  	if (!got_data) {
  		u_int32_t rnd = 0;
  
 +#if __APPLE__
-+		if (!is_launchd)
++		if (!is_path_to_socket)
 +#endif /* __APPLE__ */
  		logit("Warning: No xauth data; "
  		    "using fake authentication data for X11 forwarding.");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140619/12c4aa0a/attachment.html>


More information about the macports-changes mailing list