diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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); |