]> andersk Git - openssh.git/commitdiff
- stevesk@cvs.openbsd.org 2001/12/08 17:49:28
authordjm <djm>
Fri, 21 Dec 2001 01:39:51 +0000 (01:39 +0000)
committerdjm <djm>
Fri, 21 Dec 2001 01:39:51 +0000 (01:39 +0000)
     [channels.c pathnames.h]
     use only one path to X11 UNIX domain socket vs. an array of paths
     to try.  report from djast@cs.toronto.edu.  ok markus@

ChangeLog
channels.c
pathnames.h

index 3b5a7468fe8ad63b4e14018c07a66a7f9d0fcee3..01ccab1df1981375da1aac435b1b0400dba00958 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
    server. I have found this necessary to avoid server hangs with X input
    extensions (e.g. kinput2). Enable by setting the environment variable
    "GNOME_SSH_ASKPASS_NOGRAB"
+  - OpenBSD CVS Sync
+   - stevesk@cvs.openbsd.org 2001/12/08 17:49:28
+     [channels.c pathnames.h]
+     use only one path to X11 UNIX domain socket vs. an array of paths
+     to try.  report from djast@cs.toronto.edu.  ok markus@
 
 20011219
  - (stevesk) OpenBSD CVS sync X11 localhost display
index 40a86dccbc5388618db16f360dfe2a25ff6f5b98..97a865f56989f6744d38dee03bdf23a1d2e53802 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.146 2001/12/06 18:20:32 stevesk Exp $");
+RCSID("$OpenBSD: channels.c,v 1.147 2001/12/08 17:49:28 stevesk Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -54,6 +54,7 @@ RCSID("$OpenBSD: channels.c,v 1.146 2001/12/06 18:20:32 stevesk Exp $");
 #include "canohost.h"
 #include "key.h"
 #include "authfd.h"
+#include "pathnames.h"
 
 
 /* -- channel core */
@@ -2491,34 +2492,21 @@ x11_create_display_inet(int x11_display_offset, int gateway_ports)
        return display_number;
 }
 
-#ifndef X_UNIX_PATH
-#define X_UNIX_PATH "/tmp/.X11-unix/X"
-#endif
-
 static int
 connect_local_xsocket(u_int dnr)
 {
-       static const char *const x_sockets[] = {
-               X_UNIX_PATH "%u",
-               "/var/X/.X11-unix/X" "%u",
-               "/usr/spool/sockets/X11/" "%u",
-               NULL
-       };
        int sock;
        struct sockaddr_un addr;
-       const char *const * path;
 
-       for (path = x_sockets; *path; ++path) {
-               sock = socket(AF_UNIX, SOCK_STREAM, 0);
-               if (sock < 0)
-                       error("socket: %.100s", strerror(errno));
-               memset(&addr, 0, sizeof(addr));
-               addr.sun_family = AF_UNIX;
-               snprintf(addr.sun_path, sizeof addr.sun_path, *path, dnr);
-               if (connect(sock, (struct sockaddr *) & addr, sizeof(addr)) == 0)
-                       return sock;
-               close(sock);
-       }
+       sock = socket(AF_UNIX, SOCK_STREAM, 0);
+       if (sock < 0)
+               error("socket: %.100s", strerror(errno));
+       memset(&addr, 0, sizeof(addr));
+       addr.sun_family = AF_UNIX;
+       snprintf(addr.sun_path, sizeof addr.sun_path, _PATH_UNIX_X, dnr);
+       if (connect(sock, (struct sockaddr *) & addr, sizeof(addr)) == 0)
+               return sock;
+       close(sock);
        error("connect %.100s: %.100s", addr.sun_path, strerror(errno));
        return -1;
 }
index 0470a21596a3060a5b433f35beedd392e11c6e48..1b223e392b199d720394993c890c8b928ad29d45 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pathnames.h,v 1.9 2001/06/23 02:34:30 markus Exp $    */
+/*     $OpenBSD: pathnames.h,v 1.10 2001/12/08 17:49:28 stevesk Exp $  */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
 #define _PATH_XAUTH                    "/usr/X11R6/bin/xauth"
 #endif
 
+/* UNIX domain socket for X11 server; displaynum will replace %u */
+#ifndef _PATH_UNIX_X
+#define _PATH_UNIX_X "/tmp/.X11-unix/X%u"
+#endif
+
 /* for scp */
 #ifndef _PATH_CP
 #define _PATH_CP                       "cp"
This page took 0.048458 seconds and 5 git commands to generate.