login.c: Do not clear the environment upon init

Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>
This commit is contained in:
Roosembert Palacios 2019-10-27 17:20:57 +01:00
parent 3fd81b5f6d
commit 520a2097fd
No known key found for this signature in database
GPG Key ID: CAAAECE5C2242BB7
1 changed files with 1 additions and 10 deletions

View File

@ -207,17 +207,9 @@ void pam_diagnose(int error, struct term_buf* buf)
void env_init(struct passwd* pwd, const char* display_name)
{
extern char** environ;
char* term = getenv("TERM");
char* lang = getenv("LANG");
// clean env
environ[0] = NULL;
if (term != NULL)
{
setenv("TERM", term, 1);
}
else
if (term == NULL)
{
setenv("TERM", "linux", 1);
}
@ -228,7 +220,6 @@ void env_init(struct passwd* pwd, const char* display_name)
setenv("USER", pwd->pw_name, 1);
setenv("LOGNAME", pwd->pw_name, 1);
setenv("DISPLAY", display_name, 1);
setenv("LANG", lang, 1);
// Set PATH if specified in the configuration
if (strlen(config.path))