aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2002-04-20 05:44:36 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2002-04-20 05:44:36 +0000
commit32eb065e64cb21aa2eec47d29d7f8356591948d1 (patch)
tree24ae0d3b86a6cee790483850fcd71b9fde36364f
parent5f3d1ad8c93e816f987b4d3dac8aec75f008d48a (diff)
Notes
-rw-r--r--crypto/openssh/session.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/crypto/openssh/session.c b/crypto/openssh/session.c
index 8e6f3009c8188..26612d431a396 100644
--- a/crypto/openssh/session.c
+++ b/crypto/openssh/session.c
@@ -967,19 +967,21 @@ do_setup_env(char **env, Session *s, const char *shell)
child_set_env(&env, &envsize, "USER", pw->pw_name);
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
child_set_env(&env, &envsize, "HOME", pw->pw_dir);
-#ifndef LOGIN_CAP
+#ifndef HAVE_LOGIN_CAP
child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
snprintf(buf, sizeof buf, "%.200s/%.50s",
_PATH_MAILDIR, pw->pw_name);
child_set_env(&env, &envsize, "MAIL", buf);
-#endif /* !LOGIN_CAP */
+#endif /* !HAVE_LOGIN_CAP */
/* Normal systems set SHELL by default. */
child_set_env(&env, &envsize, "SHELL", shell);
}
+#ifndef HAVE_LOGIN_CAP
if (getenv("TZ"))
child_set_env(&env, &envsize, "TZ", getenv("TZ"));
+#endif /* !HAVE_LOGIN_CAP */
/* Set custom environment options from RSA authentication. */
if (!options.use_login) {
@@ -1005,8 +1007,10 @@ do_setup_env(char **env, Session *s, const char *shell)
if (s->ttyfd != -1)
child_set_env(&env, &envsize, "SSH_TTY", s->tty);
+#ifndef HAVE_LOGIN_CAP
if (s->term)
child_set_env(&env, &envsize, "TERM", s->term);
+#endif /* !HAVE_LOGIN_CAP */
if (s->display)
child_set_env(&env, &envsize, "DISPLAY", s->display);
if (original_command)
@@ -1139,7 +1143,7 @@ do_nologin(struct passwd *pw)
/* Set login name, uid, gid, and groups. */
static char **
-do_setusercontext(struct passwd *pw)
+do_setusercontext(struct passwd *pw, Session *s)
{
char **env = NULL;
#ifdef HAVE_LOGIN_CAP
@@ -1164,6 +1168,9 @@ do_setusercontext(struct passwd *pw)
if (getenv("TZ"))
child_set_env(&env, &envsize, "TZ", getenv("TZ"));
+ if (s->term)
+ child_set_env(&env, &envsize, "TERM", s->term);
+
/* Save parent environment */
tmpenv = environ;
/* Switch to env */
@@ -1229,7 +1236,7 @@ do_child(Session *s, const char *command)
*/
if (!options.use_login) {
do_nologin(pw);
- env = do_setusercontext(pw);
+ env = do_setusercontext(pw, s);
}
/*