[121205] trunk/dports/net/openssh
jeremyhu at macports.org
jeremyhu at macports.org
Thu Jun 19 20:00:21 PDT 2014
Revision: 121205
https://trac.macports.org/changeset/121205
Author: jeremyhu at macports.org
Date: 2014-06-19 20:00:21 -0700 (Thu, 19 Jun 2014)
Log Message:
-----------
openssh: Further launchd related changes
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-20 02:51:53 UTC (rev 121204)
+++ trunk/dports/net/openssh/Portfile 2014-06-20 03:00:21 UTC (rev 121205)
@@ -5,7 +5,7 @@
name openssh
version 6.6p1
-revision 3
+revision 4
categories net
platforms darwin
maintainers nomaintainer
Modified: trunk/dports/net/openssh/files/launchd.patch
===================================================================
--- trunk/dports/net/openssh/files/launchd.patch 2014-06-20 02:51:53 UTC (rev 121204)
+++ trunk/dports/net/openssh/files/launchd.patch 2014-06-20 03:00:21 UTC (rev 121205)
@@ -13,7 +13,7 @@
xauthdir = xauthfile = NULL;
*_proto = proto;
*_data = data;
-@@ -328,6 +332,32 @@ client_x11_get_proto(const char *display, const char *xauth_path,
+@@ -328,6 +332,33 @@ client_x11_get_proto(const char *display, const char *xauth_path,
debug("x11_get_proto: DISPLAY not set");
return;
}
@@ -36,6 +36,7 @@
+ *dot = '\0';
+ /* screen = atoi(dot + 1); */
+ if (0 == stat(path, &sbuf)) {
++ is_path_to_socket = 1;
+ debug("x11_get_proto: $DISPLAY is launchd, removing screennum");
+ setenv("DISPLAY", path, 1);
+ }
@@ -56,3 +57,50 @@
logit("Warning: No xauth data; "
"using fake authentication data for X11 forwarding.");
strlcpy(proto, SSH_X11_PROTO, sizeof proto);
+diff --git a/channels.c b/channels.c
+index 9efe89c..07153aa 100644
+--- a/channels.c
++++ b/channels.c
+@@ -3576,15 +3576,35 @@ 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 the display is a path to a socket (as set by launchd). */
++ {
++ char path[PATH_MAX];
++ struct stat sbuf;
++ int is_path_to_socket = 0;
++
++ 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)) {
++ is_path_to_socket=1;
++ }
++ }
++ }
+
+- /* OK, we now have a connection to the display. */
+- return sock;
++ if (is_path_to_socket) {
++ sock = connect_local_xsocket_path(path);
++ if (sock < 0)
++ return -1;
++
++ /* OK, we now have a connection to the display. */
++ return sock;
++ }
+ }
+ #endif
+ /*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140619/81635b08/attachment.html>
More information about the macports-changes
mailing list