comparison svr-chansession.c @ 567:893a9dd0b9dd

- set $SSH_TTY environment variable - remove extraneous (crash causing) printf()
author Matt Johnston <matt@ucc.asn.au>
date Mon, 31 Aug 2009 15:25:39 +0000
parents b321aeb57c64
children 005530560594
comparison
equal deleted inserted replaced
566:b321aeb57c64 567:893a9dd0b9dd
740 li= login_alloc_entry(getpid(), ses.authstate.username, 740 li= login_alloc_entry(getpid(), ses.authstate.username,
741 ses.remotehost, chansess->tty); 741 ses.remotehost, chansess->tty);
742 login_login(li); 742 login_login(li);
743 login_free_entry(li); 743 login_free_entry(li);
744 744
745 m_free(chansess->tty);
746
747 #ifdef DO_MOTD 745 #ifdef DO_MOTD
748 if (svr_opts.domotd) { 746 if (svr_opts.domotd) {
749 /* don't show the motd if ~/.hushlogin exists */ 747 /* don't show the motd if ~/.hushlogin exists */
750 748
751 /* 12 == strlen("/.hushlogin\0") */ 749 /* 12 == strlen("/.hushlogin\0") */
882 addnewvar("PATH", DEFAULT_PATH); 880 addnewvar("PATH", DEFAULT_PATH);
883 if (chansess->term != NULL) { 881 if (chansess->term != NULL) {
884 addnewvar("TERM", chansess->term); 882 addnewvar("TERM", chansess->term);
885 } 883 }
886 884
887 printf("adding option %p %s\n", ses.authstate.pubkey_options, 885 if (chansess->tty) {
888 ses.authstate.pubkey_options->original_command); 886 addnewvar("SSH_TTY", chansess->tty);
889 887 }
888
890 #ifdef ENABLE_SVR_PUBKEY_OPTIONS 889 #ifdef ENABLE_SVR_PUBKEY_OPTIONS
891 if (ses.authstate.pubkey_options && 890 if (ses.authstate.pubkey_options &&
892 ses.authstate.pubkey_options->original_command) { 891 ses.authstate.pubkey_options->original_command) {
893 addnewvar("SSH_ORIGINAL_COMMAND", 892 addnewvar("SSH_ORIGINAL_COMMAND",
894 ses.authstate.pubkey_options->original_command); 893 ses.authstate.pubkey_options->original_command);