summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/session.c b/session.c
index 0ccd2006d..9074525a4 100644
--- a/session.c
+++ b/session.c
@@ -512,10 +512,17 @@ do_exec_no_pty(Session *s, const char *command)
512 perror("dup2 stderr"); 512 perror("dup2 stderr");
513#endif /* USE_PIPES */ 513#endif /* USE_PIPES */
514 514
515#ifdef _UNICOS
516 cray_init_job(s->pw); /* set up cray jid and tmpdir */
517#endif
518
515 /* Do processing for the child (exec command etc). */ 519 /* Do processing for the child (exec command etc). */
516 do_child(s, command); 520 do_child(s, command);
517 /* NOTREACHED */ 521 /* NOTREACHED */
518 } 522 }
523#ifdef _UNICOS
524 signal(WJSIGNAL, cray_job_termination_handler);
525#endif /* _UNICOS */
519#ifdef HAVE_CYGWIN 526#ifdef HAVE_CYGWIN
520 if (is_winnt) 527 if (is_winnt)
521 cygwin_set_impersonation_token(INVALID_HANDLE_VALUE); 528 cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
@@ -603,8 +610,12 @@ do_exec_pty(Session *s, const char *command)
603 610
604 /* record login, etc. similar to login(1) */ 611 /* record login, etc. similar to login(1) */
605#ifndef HAVE_OSF_SIA 612#ifndef HAVE_OSF_SIA
606 if (!(options.use_login && command == NULL)) 613 if (!(options.use_login && command == NULL)) {
614#ifdef _UNICOS
615 cray_init_job(s->pw); /* set up cray jid and tmpdir */
616#endif /* _UNICOS */
607 do_login(s, command); 617 do_login(s, command);
618 }
608# ifdef LOGIN_NEEDS_UTMPX 619# ifdef LOGIN_NEEDS_UTMPX
609 else 620 else
610 do_pre_login(s); 621 do_pre_login(s);
@@ -615,6 +626,9 @@ do_exec_pty(Session *s, const char *command)
615 do_child(s, command); 626 do_child(s, command);
616 /* NOTREACHED */ 627 /* NOTREACHED */
617 } 628 }
629#ifdef _UNICOS
630 signal(WJSIGNAL, cray_job_termination_handler);
631#endif /* _UNICOS */
618#ifdef HAVE_CYGWIN 632#ifdef HAVE_CYGWIN
619 if (is_winnt) 633 if (is_winnt)
620 cygwin_set_impersonation_token(INVALID_HANDLE_VALUE); 634 cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
@@ -755,6 +769,7 @@ do_login(Session *s, const char *command)
755 printf("%s\n", aixloginmsg); 769 printf("%s\n", aixloginmsg);
756#endif /* WITH_AIXAUTHENTICATE */ 770#endif /* WITH_AIXAUTHENTICATE */
757 771
772#ifndef NO_SSH_LASTLOG
758 if (options.print_lastlog && s->last_login_time != 0) { 773 if (options.print_lastlog && s->last_login_time != 0) {
759 time_string = ctime(&s->last_login_time); 774 time_string = ctime(&s->last_login_time);
760 if (strchr(time_string, '\n')) 775 if (strchr(time_string, '\n'))
@@ -765,6 +780,7 @@ do_login(Session *s, const char *command)
765 printf("Last login: %s from %s\r\n", time_string, 780 printf("Last login: %s from %s\r\n", time_string,
766 s->hostname); 781 s->hostname);
767 } 782 }
783#endif /* NO_SSH_LASTLOG */
768 784
769 do_motd(); 785 do_motd();
770} 786}
@@ -1024,6 +1040,11 @@ do_setup_env(Session *s, const char *shell)
1024 child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND", 1040 child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND",
1025 original_command); 1041 original_command);
1026 1042
1043#ifdef _UNICOS
1044 if (cray_tmpdir[0] != '\0')
1045 child_set_env(&env, &envsize, "TMPDIR", cray_tmpdir);
1046#endif /* _UNICOS */
1047
1027#ifdef _AIX 1048#ifdef _AIX
1028 { 1049 {
1029 char *cp; 1050 char *cp;
@@ -1275,6 +1296,10 @@ do_child(Session *s, const char *command)
1275 if (options.use_login && command != NULL) 1296 if (options.use_login && command != NULL)
1276 options.use_login = 0; 1297 options.use_login = 0;
1277 1298
1299#ifdef _UNICOS
1300 cray_setup(pw->pw_uid, pw->pw_name, command);
1301#endif /* _UNICOS */
1302
1278 /* 1303 /*
1279 * Login(1) does this as well, and it needs uid 0 for the "-h" 1304 * Login(1) does this as well, and it needs uid 0 for the "-h"
1280 * switch, so we let login(1) to this for us. 1305 * switch, so we let login(1) to this for us.