This adds two environment variables into environment of user: LANG & MM_CHARSET,

when used standard login via telnet or console

However when used openssh, then sshd does not setup LANG & MM_CHARSET into envir
onment for user in russian class

Code for this operation did not exists in openssh port !

PR:		21146
Submitted by:	odip@bionet.nsc.ru
This commit is contained in:
Dirk Meyer 2001-06-25 06:28:48 +00:00
parent 966c3a0792
commit 817e1df8d4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=44413
2 changed files with 42 additions and 4 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= OpenSSH
PORTVERSION= 2.9
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= security
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/ \
ftp://ftp.usa.openbsd.org/pub/OpenBSD/OpenSSH/ \

View file

@ -1,5 +1,5 @@
--- session.c.orig Tue Apr 17 21:34:25 2001
+++ session.c Sun Jun 10 19:42:13 2001
+++ session.c Mon Jun 25 07:51:19 2001
@@ -58,6 +58,12 @@
#include "canohost.h"
#include "session.h"
@ -75,7 +75,45 @@
do_motd();
}
@@ -1027,7 +1067,7 @@
@@ -914,6 +954,10 @@
env[0] = NULL;
if (!options.use_login) {
+#ifdef HAVE_LOGIN_CAP
+ char *var;
+#endif /* HAVE_LOGIN_CAP */
+
/* Set basic environment. */
child_set_env(&env, &envsize, "USER", pw->pw_name);
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
@@ -921,6 +965,12 @@
#ifdef HAVE_LOGIN_CAP
(void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH);
child_set_env(&env, &envsize, "PATH", getenv("PATH"));
+ var= login_getcapstr(lc, "lang", NULL, NULL);
+ if ( var ) child_set_env(&env, &envsize, "LANG", var);
+ var= login_getcapstr(lc, "charset", NULL, NULL);
+ if ( var ) child_set_env(&env, &envsize, "MM_CHARSET", var);
+ var= login_getcapstr(lc, "timezone", NULL, NULL);
+ if ( var ) child_set_env(&env, &envsize, "TZ", var);
#else
child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
#endif
@@ -932,8 +982,13 @@
/* Normal systems set SHELL by default. */
child_set_env(&env, &envsize, "SHELL", shell);
}
+#ifdef HAVE_LOGIN_CAP
+#else /* HAVE_LOGIN_CAP */
+ if (getenv("TZ"))
+ child_set_env(&env, &envsize, "TZ", getenv("TZ"));
if (getenv("TZ"))
child_set_env(&env, &envsize, "TZ", getenv("TZ"));
+#endif /* HAVE_LOGIN_CAP */
/* Set custom environment options from RSA authentication. */
while (custom_environment) {
@@ -1027,7 +1082,7 @@
* initgroups, because at least on Solaris 2.3 it leaves file
* descriptors open.
*/
@ -84,7 +122,7 @@
close(i);
/* Change current directory to the user\'s home directory. */
@@ -1051,6 +1091,28 @@
@@ -1051,6 +1106,28 @@
* in this order).
*/
if (!options.use_login) {