diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ssh.c | 21 |
2 files changed, 21 insertions, 5 deletions
@@ -25,6 +25,9 @@ | |||
25 | - stevesk@cvs.openbsd.org 2002/01/27 14:57:46 | 25 | - stevesk@cvs.openbsd.org 2002/01/27 14:57:46 |
26 | [channels.c servconf.c servconf.h session.c sshd.8 sshd_config] | 26 | [channels.c servconf.c servconf.h session.c sshd.8 sshd_config] |
27 | add X11UseLocalhost; ok markus@ | 27 | add X11UseLocalhost; ok markus@ |
28 | - stevesk@cvs.openbsd.org 2002/01/27 18:08:17 | ||
29 | [ssh.c] | ||
30 | handle simple case to identify FamilyLocal display; ok markus@ | ||
28 | 31 | ||
29 | 20020130 | 32 | 20020130 |
30 | - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@ | 33 | - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@ |
@@ -7427,4 +7430,4 @@ | |||
7427 | - Wrote replacements for strlcpy and mkdtemp | 7430 | - Wrote replacements for strlcpy and mkdtemp |
7428 | - Released 1.0pre1 | 7431 | - Released 1.0pre1 |
7429 | 7432 | ||
7430 | $Id: ChangeLog,v 1.1805 2002/02/05 01:11:34 djm Exp $ | 7433 | $Id: ChangeLog,v 1.1806 2002/02/05 01:12:09 djm Exp $ |
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: ssh.c,v 1.158 2002/01/16 13:17:51 markus Exp $"); | 42 | RCSID("$OpenBSD: ssh.c,v 1.159 2002/01/27 18:08:17 stevesk Exp $"); |
43 | 43 | ||
44 | #include <openssl/evp.h> | 44 | #include <openssl/evp.h> |
45 | #include <openssl/err.h> | 45 | #include <openssl/err.h> |
@@ -793,14 +793,27 @@ x11_get_proto(char **_proto, char **_data) | |||
793 | static char proto[512], data[512]; | 793 | static char proto[512], data[512]; |
794 | FILE *f; | 794 | FILE *f; |
795 | int got_data = 0, i; | 795 | int got_data = 0, i; |
796 | char *display; | ||
796 | 797 | ||
797 | *_proto = proto; | 798 | *_proto = proto; |
798 | *_data = data; | 799 | *_data = data; |
799 | proto[0] = data[0] = '\0'; | 800 | proto[0] = data[0] = '\0'; |
800 | if (options.xauth_location) { | 801 | if (options.xauth_location && (display = getenv("DISPLAY"))) { |
801 | /* Try to get Xauthority information for the display. */ | 802 | /* Try to get Xauthority information for the display. */ |
802 | snprintf(line, sizeof line, "%.100s list %.200s 2>" _PATH_DEVNULL, | 803 | if (strncmp(display, "localhost:", 10) == 0) |
803 | options.xauth_location, getenv("DISPLAY")); | 804 | /* |
805 | * Handle FamilyLocal case where $DISPLAY does | ||
806 | * not match an authorization entry. For this we | ||
807 | * just try "xauth list unix:displaynum.screennum". | ||
808 | * XXX: "localhost" match to determine FamilyLocal | ||
809 | * is not perfect. | ||
810 | */ | ||
811 | snprintf(line, sizeof line, "%.100s list unix:%s 2>" | ||
812 | _PATH_DEVNULL, options.xauth_location, display+10); | ||
813 | else | ||
814 | snprintf(line, sizeof line, "%.100s list %.200s 2>" | ||
815 | _PATH_DEVNULL, options.xauth_location, display); | ||
816 | debug2("x11_get_proto %s", line); | ||
804 | f = popen(line, "r"); | 817 | f = popen(line, "r"); |
805 | if (f && fgets(line, sizeof(line), f) && | 818 | if (f && fgets(line, sizeof(line), f) && |
806 | sscanf(line, "%*s %511s %511s", proto, data) == 2) | 819 | sscanf(line, "%*s %511s %511s", proto, data) == 2) |