]> andersk Git - openssh.git/commitdiff
- stevesk@cvs.openbsd.org 2002/01/26 16:44:22
authordjm <djm>
Tue, 5 Feb 2002 01:11:02 +0000 (01:11 +0000)
committerdjm <djm>
Tue, 5 Feb 2002 01:11:02 +0000 (01:11 +0000)
     [includes.h session.c]
     revert code to add x11 localhost display authorization entry for
     hostname/unix:d and uts.nodename/unix:d if nodename was different than
     hostname.  just add entry for unix:d instead.  ok markus@

ChangeLog
includes.h
session.c

index aa24192660a32c0f9717ee10931b1bc9252a5d11..8d8db0a6547c869f91d6bc5226e67a3e5f1ceea3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - markus@cvs.openbsd.org 2002/01/25 22:07:40
      [kex.c kexdh.c kexgex.c key.c mac.c]
      use EVP_MD_size(evp_md) and not evp_md->md_size; ok steveks@
+   - stevesk@cvs.openbsd.org 2002/01/26 16:44:22
+     [includes.h session.c]
+     revert code to add x11 localhost display authorization entry for
+     hostname/unix:d and uts.nodename/unix:d if nodename was different than
+     hostname.  just add entry for unix:d instead.  ok markus@
 
 20020130
  - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
index c992b152e4f762b96dcc11e3836066e86058f194..4740418a75ae5ea795af02fd7f3dbcfb4d7fca6d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: includes.h,v 1.16 2001/12/19 15:43:11 stevesk Exp $   */
+/*     $OpenBSD: includes.h,v 1.17 2002/01/26 16:44:22 stevesk Exp $   */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -28,7 +28,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <sys/resource.h>
-#include <sys/utsname.h>
 
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
index a5ad077c916a9e86214c1d70dc6a6b0ed372a1ae..268d1384e0a95187230cbaee246a0be3e6cdcc4d 100644 (file)
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.117 2001/12/28 14:50:54 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.118 2002/01/26 16:44:22 stevesk Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -111,7 +111,7 @@ struct Session {
        int     display_number;
        char    *display;
        int     screen;
-       char    *auth_display[2];
+       char    *auth_display;
        char    *auth_proto;
        char    *auth_data;
        int     single_connection;
@@ -1390,25 +1390,16 @@ do_child(Session *s, const char *command)
                                fprintf(stderr,
                                    "Running %.100s add "
                                    "%.100s %.100s %.100s\n",
-                                   options.xauth_location, s->auth_display[0],
+                                   options.xauth_location, s->auth_display,
                                    s->auth_proto, s->auth_data);
-                               if (s->auth_display[1])
-                                       fprintf(stderr,
-                                           "add %.100s %.100s %.100s\n",
-                                           s->auth_display[1],
-                                           s->auth_proto, s->auth_data);
                        }
                        snprintf(cmd, sizeof cmd, "%s -q -",
                            options.xauth_location);
                        f = popen(cmd, "w");
                        if (f) {
                                fprintf(f, "add %s %s %s\n",
-                                   s->auth_display[0], s->auth_proto,
+                                   s->auth_display, s->auth_proto,
                                    s->auth_data);
-                               if (s->auth_display[1])
-                                       fprintf(f, "add %s %s %s\n",
-                                           s->auth_display[1], s->auth_proto,
-                                           s->auth_data);
                                pclose(f);
                        } else {
                                fprintf(stderr, "Could not run %s\n",
@@ -1907,10 +1898,8 @@ session_close(Session *s)
                xfree(s->term);
        if (s->display)
                xfree(s->display);
-       if (s->auth_display[0])
-               xfree(s->auth_display[0]);
-       if (s->auth_display[1])
-               xfree(s->auth_display[1]);
+       if (s->auth_display)
+               xfree(s->auth_display);
        if (s->auth_data)
                xfree(s->auth_data);
        if (s->auth_proto)
@@ -2046,31 +2035,13 @@ session_setup_x11fwd(Session *s)
         * authorization entry is added with xauth(1).  This will be
         * different than the DISPLAY string for localhost displays.
         */
-       s->auth_display[1] = NULL;
        if (!options.gateway_ports) {
-               struct utsname uts;
-
                snprintf(display, sizeof display, "localhost:%d.%d",
                    s->display_number, s->screen);
-               snprintf(auth_display, sizeof auth_display, "%.400s/unix:%d.%d",
-                   hostname, s->display_number, s->screen);
+               snprintf(auth_display, sizeof auth_display, "unix:%d.%d",
+                   s->display_number, s->screen);
                s->display = xstrdup(display);
-               s->auth_display[0] = xstrdup(auth_display);
-               /*
-                * Xlib may use gethostbyname() or uname() hostname to
-                * look up authorization data for FamilyLocal; see:
-                * xc/lib/xtrans/Xtrans.c:TRANS(GetHostname)
-                * We just add authorization entries with both
-                * hostname and nodename if they are different.
-                */
-               if (uname(&uts) == -1)
-                       fatal("uname: %.100s", strerror(errno));
-               if (strcmp(hostname, uts.nodename) != 0) {
-                       snprintf(auth_display, sizeof auth_display,
-                           "%.400s/unix:%d.%d", uts.nodename,
-                           s->display_number, s->screen);
-                       s->auth_display[1] = xstrdup(auth_display);
-               }
+               s->auth_display = xstrdup(auth_display);
        } else {
 #ifdef IPADDR_IN_DISPLAY
                struct hostent *he;
@@ -2090,7 +2061,7 @@ session_setup_x11fwd(Session *s)
                    s->display_number, s->screen);
 #endif
                s->display = xstrdup(display);
-               s->auth_display[0] = xstrdup(display);
+               s->auth_display = xstrdup(display);
        }
 
        return 1;
This page took 1.449205 seconds and 5 git commands to generate.