comparison svr-chansession.c @ 546:568638be7203 agent-client

propagate from branch 'au.asn.ucc.matt.dropbear' (head 899a8851a5edf840b2f7925bcc26ffe99dcac54d) to branch 'au.asn.ucc.matt.dropbear.cli-agent' (head 6bbab8364de17bd9ecb1dee5ffb796e48c0380d2)
author Matt Johnston <matt@ucc.asn.au>
date Wed, 01 Jul 2009 04:16:32 +0000
parents d4bbc0039008
children 52d7301e46bd
comparison
equal deleted inserted replaced
500:d588e3ea557a 546:568638be7203
661 ses.maxfd = MAX(ses.maxfd, channel->errfd); 661 ses.maxfd = MAX(ses.maxfd, channel->errfd);
662 662
663 addchildpid(chansess, chansess->pid); 663 addchildpid(chansess, chansess->pid);
664 664
665 if (svr_ses.lastexit.exitpid != -1) { 665 if (svr_ses.lastexit.exitpid != -1) {
666 unsigned int i;
666 TRACE(("parent side: lastexitpid is %d", svr_ses.lastexit.exitpid)) 667 TRACE(("parent side: lastexitpid is %d", svr_ses.lastexit.exitpid))
667 /* The child probably exited and the signal handler triggered 668 /* The child probably exited and the signal handler triggered
668 * possibly before we got around to adding the childpid. So we fill 669 * possibly before we got around to adding the childpid. So we fill
669 * out its data manually */ 670 * out its data manually */
670 int i;
671 for (i = 0; i < svr_ses.childpidsize; i++) { 671 for (i = 0; i < svr_ses.childpidsize; i++) {
672 if (svr_ses.childpids[i].pid == svr_ses.lastexit.exitpid) { 672 if (svr_ses.childpids[i].pid == svr_ses.lastexit.exitpid) {
673 TRACE(("found match for lastexitpid")) 673 TRACE(("found match for lastexitpid"))
674 svr_ses.childpids[i].chansess->exit = svr_ses.lastexit; 674 svr_ses.childpids[i].chansess->exit = svr_ses.lastexit;
675 svr_ses.lastexit.exitpid = -1; 675 svr_ses.lastexit.exitpid = -1;
876 /* set env vars */ 876 /* set env vars */
877 addnewvar("USER", ses.authstate.pw_name); 877 addnewvar("USER", ses.authstate.pw_name);
878 addnewvar("LOGNAME", ses.authstate.pw_name); 878 addnewvar("LOGNAME", ses.authstate.pw_name);
879 addnewvar("HOME", ses.authstate.pw_dir); 879 addnewvar("HOME", ses.authstate.pw_dir);
880 addnewvar("SHELL", get_user_shell()); 880 addnewvar("SHELL", get_user_shell());
881 addnewvar("PATH", DEFAULT_PATH);
881 if (chansess->term != NULL) { 882 if (chansess->term != NULL) {
882 addnewvar("TERM", chansess->term); 883 addnewvar("TERM", chansess->term);
883 } 884 }
884 885
885 /* change directory */ 886 /* change directory */