mirror of
https://github.com/clearml/dropbear
synced 2025-03-06 12:02:51 +00:00
keep LANG env variable for child process (#111)
This commit is contained in:
parent
dc016f900b
commit
41d4b4e7f7
@ -931,6 +931,11 @@ static void addchildpid(struct ChanSess *chansess, pid_t pid) {
|
|||||||
static void execchild(const void *user_data) {
|
static void execchild(const void *user_data) {
|
||||||
const struct ChanSess *chansess = user_data;
|
const struct ChanSess *chansess = user_data;
|
||||||
char *usershell = NULL;
|
char *usershell = NULL;
|
||||||
|
char *cp = NULL;
|
||||||
|
char *envcp = getenv("LANG");
|
||||||
|
if (envcp != NULL) {
|
||||||
|
cp = m_strdup(envcp);
|
||||||
|
}
|
||||||
|
|
||||||
/* with uClinux we'll have vfork()ed, so don't want to overwrite the
|
/* with uClinux we'll have vfork()ed, so don't want to overwrite the
|
||||||
* hostkey. can't think of a workaround to clear it */
|
* hostkey. can't think of a workaround to clear it */
|
||||||
@ -991,6 +996,10 @@ static void execchild(const void *user_data) {
|
|||||||
addnewvar("HOME", ses.authstate.pw_dir);
|
addnewvar("HOME", ses.authstate.pw_dir);
|
||||||
addnewvar("SHELL", get_user_shell());
|
addnewvar("SHELL", get_user_shell());
|
||||||
addnewvar("PATH", DEFAULT_PATH);
|
addnewvar("PATH", DEFAULT_PATH);
|
||||||
|
if (cp != NULL) {
|
||||||
|
addnewvar("LANG", cp);
|
||||||
|
m_free(cp);
|
||||||
|
}
|
||||||
if (chansess->term != NULL) {
|
if (chansess->term != NULL) {
|
||||||
addnewvar("TERM", chansess->term);
|
addnewvar("TERM", chansess->term);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user