]> andersk Git - openssh.git/blobdiff - session.c
Up ver
[openssh.git] / session.c
index 480a1635a49aeecca0fbaa564bde1d06b3477de4..4b7404f7380c6d62c4d4c5eb74b590e106e4a282 100644 (file)
--- a/session.c
+++ b/session.c
@@ -1035,13 +1035,20 @@ do_child(const char *command, struct passwd * pw, const char *term,
                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);
@@ -1473,7 +1480,11 @@ session_exit_message(Session *s, int status)
                channel_request_start(s->chanid,
                    "exit-signal", 0);
                packet_put_int(WTERMSIG(status));
+#ifdef WCOREDUMP
                packet_put_char(WCOREDUMP(status));
+#else /* WCOREDUMP */
+               packet_put_char(0);
+#endif /* WCOREDUMP */
                packet_put_cstring("");
                packet_put_cstring("");
                packet_send();
This page took 0.070661 seconds and 4 git commands to generate.