Mercurial > dropbear
comparison svr-chansession.c @ 415:8b9aba1d5fa4 channel-fix
merge of '73fe066c5d9e2395354ba74756124d45c978a04d'
and 'f5014cc84558f1e8eba42dbecf9f72f94bfe6134'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 06 Feb 2007 16:00:18 +0000 |
parents | 173a5f89666c |
children | a01c0c8e543a |
comparison
equal
deleted
inserted
replaced
414:c53a26c430e5 | 415:8b9aba1d5fa4 |
---|---|
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 /* If the pid wasn't matched, then we might have hit the race mentioned | 102 /* If the pid wasn't matched, then we might have hit the race mentioned |
103 * above. So we just store the info for the parent to deal with */ | 103 * above. So we just store the info for the parent to deal with */ |
104 if (!exit) { | 104 if (exit == NULL) { |
105 exit = &svr_ses.lastexit; | 105 exit = &svr_ses.lastexit; |
106 } | 106 } |
107 | 107 |
108 exit->exitpid = pid; | 108 exit->exitpid = pid; |
109 if (WIFEXITED(status)) { | 109 if (WIFEXITED(status)) { |
1005 newvar = m_malloc(plen + vlen + 2); /* 2 is for '=' and '\0' */ | 1005 newvar = m_malloc(plen + vlen + 2); /* 2 is for '=' and '\0' */ |
1006 memcpy(newvar, param, plen); | 1006 memcpy(newvar, param, plen); |
1007 newvar[plen] = '='; | 1007 newvar[plen] = '='; |
1008 memcpy(&newvar[plen+1], var, vlen); | 1008 memcpy(&newvar[plen+1], var, vlen); |
1009 newvar[plen+vlen+1] = '\0'; | 1009 newvar[plen+vlen+1] = '\0'; |
1010 /* newvar is leaked here, but that's part of putenv()'s semantics */ | |
1010 if (putenv(newvar) < 0) { | 1011 if (putenv(newvar) < 0) { |
1011 dropbear_exit("environ error"); | 1012 dropbear_exit("environ error"); |
1012 } | 1013 } |
1013 } | 1014 } |