- Xauth fix from Markus Friedl <markus.friedl@informatik.uni-erlangen.de>
diff --git a/ChangeLog b/ChangeLog
index 0628bb0..a4e0d73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+20000520
+ - Xauth fix from Markus Friedl <markus.friedl@informatik.uni-erlangen.de>
+
 20000518
  - Include Andre Lucas' fixprogs script. Forgot to "cvs add" it yesterday
  - OpenBSD CVS updates:
diff --git a/session.c b/session.c
index 23c5660..4b7404f 100644
--- a/session.c
+++ b/session.c
@@ -1035,13 +1035,20 @@
 		else {
 			/* Add authority data to .Xauthority if appropriate. */
 			if (auth_proto != NULL && auth_data != NULL) {
-				if (debug_flag)
+				char *screen = strchr(display, ':');
+				if (debug_flag) {
 					fprintf(stderr, "Running %.100s add %.100s %.100s %.100s\n",
-						XAUTH_PATH, display, auth_proto, auth_data);
-
+					    XAUTH_PATH, display, auth_proto, auth_data);
+					if (screen != NULL)
+						fprintf(stderr, "Adding %.*s/unix%s %s %s\n",
+						    screen-display, display, screen, auth_proto, auth_data);
+				}
 				f = popen(XAUTH_PATH " -q -", "w");
 				if (f) {
 					fprintf(f, "add %s %s %s\n", display, auth_proto, auth_data);
+					if (screen != NULL) 
+						fprintf(f, "add %.*s/unix%s %s %s\n",
+						     screen-display, display, screen, auth_proto, auth_data);
 					pclose(f);
 				} else
 					fprintf(stderr, "Could not run %s -q -\n", XAUTH_PATH);
diff --git a/sshd.c b/sshd.c
index 256018f..39fbcba 100644
--- a/sshd.c
+++ b/sshd.c
@@ -14,7 +14,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.116 2000/05/17 08:20:16 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.117 2000/05/18 13:27:36 djm Exp $");
 
 #include "xmalloc.h"
 #include "rsa.h"