=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/session.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -r1.117 -r1.118 --- src/usr.bin/ssh/session.c 2001/12/28 14:50:54 1.117 +++ src/usr.bin/ssh/session.c 2002/01/26 16:44:22 1.118 @@ -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" @@ -76,7 +76,7 @@ int display_number; char *display; int screen; - char *auth_display[2]; + char *auth_display; char *auth_proto; char *auth_data; int single_connection; @@ -1039,25 +1039,16 @@ 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", @@ -1549,10 +1540,8 @@ 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) @@ -1688,36 +1677,18 @@ * 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 { snprintf(display, sizeof display, "%.400s:%d.%d", hostname, s->display_number, s->screen); s->display = xstrdup(display); - s->auth_display[0] = xstrdup(display); + s->auth_display = xstrdup(display); } return 1;