summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-20 12:49:31 +1000
committerDamien Miller <djm@mindrot.org>2000-05-20 12:49:31 +1000
commitd999ae26b7bad888b7a9b375faa38c1d6a8db1ce (patch)
tree30fe70eadced6dc89b2a37848015de9e3958926f /session.c
parentef7df540735d5ee8889f7f87cc74fc4ec5f4e260 (diff)
- Xauth fix from Markus Friedl <markus.friedl@informatik.uni-erlangen.de>
Diffstat (limited to 'session.c')
-rw-r--r--session.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/session.c b/session.c
index 23c566050..4b7404f73 100644
--- a/session.c
+++ b/session.c
@@ -1035,13 +1035,20 @@ do_child(const char *command, struct passwd * pw, const char *term,
1035 else { 1035 else {
1036 /* Add authority data to .Xauthority if appropriate. */ 1036 /* Add authority data to .Xauthority if appropriate. */
1037 if (auth_proto != NULL && auth_data != NULL) { 1037 if (auth_proto != NULL && auth_data != NULL) {
1038 if (debug_flag) 1038 char *screen = strchr(display, ':');
1039 if (debug_flag) {
1039 fprintf(stderr, "Running %.100s add %.100s %.100s %.100s\n", 1040 fprintf(stderr, "Running %.100s add %.100s %.100s %.100s\n",
1040 XAUTH_PATH, display, auth_proto, auth_data); 1041 XAUTH_PATH, display, auth_proto, auth_data);
1041 1042 if (screen != NULL)
1043 fprintf(stderr, "Adding %.*s/unix%s %s %s\n",
1044 screen-display, display, screen, auth_proto, auth_data);
1045 }
1042 f = popen(XAUTH_PATH " -q -", "w"); 1046 f = popen(XAUTH_PATH " -q -", "w");
1043 if (f) { 1047 if (f) {
1044 fprintf(f, "add %s %s %s\n", display, auth_proto, auth_data); 1048 fprintf(f, "add %s %s %s\n", display, auth_proto, auth_data);
1049 if (screen != NULL)
1050 fprintf(f, "add %.*s/unix%s %s %s\n",
1051 screen-display, display, screen, auth_proto, auth_data);
1045 pclose(f); 1052 pclose(f);
1046 } else 1053 } else
1047 fprintf(stderr, "Could not run %s -q -\n", XAUTH_PATH); 1054 fprintf(stderr, "Could not run %s -q -\n", XAUTH_PATH);